-
Notifications
You must be signed in to change notification settings - Fork 93
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
Update priority #28
Comments
Hey Tu, I was surprised to see that we indeed do no have any examples of how to update priorities in the example. The method you are looking for is I'll keep this issue until the examples have been updated but an example of how to update the priorities could look something like this: # Batches 2 sequences together.
# Shapes of items is now [2, 3, 10, 10].
dataset = dataset.batch(2)
for sample in dataset.take(1):
# Results in the following format.
print(sample.info.key) # ([2, 3], uint64)
print(sample.info.probability) # ([2, 3], float64)
observation, action = sample.data
print(observation) # ([2, 3, 10, 10], uint8)
print(action) # ([2, 3, 2], float32)
# Set the priority of all sampled items to 0.5.
client.mutate_priorities('my_table', {
int(key[0]): 0.5 # key[0] => uint64 scalar.
for key in sample.info.key # for ([3], uint64) in ([2, 3], uint64)
}) |
Thank you @acassirer. That's very helpful to me. |
Just notice that I used another github account to reply you :) It's still me who posted the question. Thanks again. |
Leaving this open until Albin updates examples. |
Hi @acassirer, I am using |
Hey @abhishekbisht1429, I can't speak for the transformations that |
Thanks @acassirer for your comment. After some search and trials I figured it out, leaving this comment here in case someone stumbles upon this problem. Each item in the dataset returned by |
Since I followed PER which is described in this paper, I believe that there must exist a way to update priority every time we compute TD error on every minibatch. However, I carefully looked at all your examples but it seems no function like this existing.
The text was updated successfully, but these errors were encountered: