Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

memory for state #14

Open
fi000 opened this issue Jun 26, 2018 · 4 comments
Open

memory for state #14

fi000 opened this issue Jun 26, 2018 · 4 comments

Comments

@fi000
Copy link

fi000 commented Jun 26, 2018

thanks Keon for your great code!
I have two questions:
1- What does [0] means in self.model.predict(next_state)[0] and return np.argmin(act_values[0])? Does this mean that first element of batch?
2-If in addition to batch, I need that my state is the state from K times before, what is the necessary change in order to do this? I want to send the state=state[i-k+1]....state[i-1],state[i] not only one state! How I can do this?

Thanks again

@CarterEllsworth
Copy link

CarterEllsworth commented Jul 20, 2018

  1. Keras Model API tell us that model.predict(predict_batch) returns a numpy array with an array of predictions for each element in predict_batch. Since model.predict is being called on a single array, next_state then we want the first and only element in the prediction array. Hence '[0]'

@fi000
Copy link
Author

fi000 commented Aug 27, 2018

Thanks for question 1- I did not understand how to do it?
How to have a memory on state? in nature paper the memory is used and it is equal to 4! and this is in addition to using batch

@pskrunner14
Copy link
Contributor

@fi000 can you provide a link to the said paper.

  1. self.model.predict(next_state)[0] predicts on batch as @CarterEllsworth pointed out. It returns an array of predictions for each of the elements in the batch but since we're only predicting on one state element we only the first and only prediction, hence the [0].

  2. You could somehow normalize over the last k states as I've implemented here. You'll need to adjust the dimensions according to whatever best suits your task.

@fi000
Copy link
Author

fi000 commented Sep 3, 2018

@pskrunner14 You can refer to paper "Playing Atari with Deep Reinforcement Learning" section 4.1 last sentences of first paragraph! I have an state with 5 inputs but I have a problem in giving for instance 4 states in a frame! How we could do this in this code?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants