Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi output regression #254

Open
laurenskz opened this issue Oct 4, 2021 · 5 comments
Open

Multi output regression #254

laurenskz opened this issue Oct 4, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@laurenskz
Copy link

Is it currently possible to perform a regression with multiple outputs. I.e a single instance of the dataset looks as follows:
x = [0.7,0.6,0.3]
y = [0.2,0.3]

This would seem impossible given the current design of the Dataset interface where the y value always consists of a single float.

A possible use case is using a neural network for predicting q values in reinforcement learning (Deep q learning). The keras API currently allows this.

@zaleslaw
Copy link
Collaborator

Could you please share a Keras example for Deep Q Learning with multiple outputs for regression, hope to fix it in the 0.4 or 0.5 release of KotlinDL

@zaleslaw zaleslaw added this to the 0.4 milestone Oct 21, 2021
@zaleslaw zaleslaw added enhancement New feature or request question Further information is requested labels Oct 21, 2021
@laurenskz
Copy link
Author

Thanks for your reply! This is a really common approach for implementing a deep Q network:
https://keras.io/examples/rl/deep_q_network_breakout/

@zaleslaw
Copy link
Collaborator

Thanks for the example you gave me.
Multiple outputs for models are not supported yet, but I agree that this is a good idea

@zaleslaw
Copy link
Collaborator

Added a note for a possible solution to this problem: the following example should work.

The current OnHeapDataset supports only y as FloatArray but should be Array like x field. At this moment the FloatArray converts to Array in internalFit method to create a Tensor.

OnHeapDataset could have two constructors: with FloatArray and Array

@zaleslaw zaleslaw self-assigned this Dec 15, 2021
@zaleslaw zaleslaw modified the milestones: 0.4, 0.5 Feb 1, 2022
@ermolenkodev ermolenkodev removed this from the 0.5 milestone Sep 21, 2022
@kuhnmi
Copy link

kuhnmi commented Jun 9, 2023

I would like to use the kotlindl library for a deep-q-learning task, but am currently struggling with exactly this issue. Are there any plans to extend the dataset definition as outlined by @zaleslaw in #254 (comment) in the near future to make this possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants