Closed amjass12 closed 3 years ago
Hello,
I just want to clarify that whenevermodel.action_value is called, it is predicting on one observation (4,) and that the only time the batch size is used is for training on batch.
Yes, that is correct.
If this is the case, for action_value, why is model.predict not used instead of predict_on_batch
At the time predict
incurred some additional performance penalty, it might have been fixed since -- worth testing.
If you look at the sources, predict does quite a bit of additional work until eventually calling to the same function as predict_on_batch.
Hi @inoryy ,
thank you for clarifying - this all makes sense!
I will test model.predict and see how this works - thanks yo again
Hi! I have a question about the training loop for clarification:
in this step:
Whenever action value is called: is this working on one tuple (i.e one observation)? or a batch of tuples (batch_size length)? Im slightly confused since the action_value method uses the predict_on_batch function from tensorflow
when i print
next_obs
shape its a simple 4 tuple(4,)
from which i would conlude this is just one state observation.when i print
observation
- from whichtrain_on_batch
is used - it is indeed of the batch size(64,4)
I just want to clarify that whenevermodel.action_value is called, it is predicting on one observation (4,) and that the only time the batch size is used is for training on batch. If this is the case, for action_value, why is
model.predict
not used instead ofpredict_on_batch
thanks for your time!