I am new to Unity ML-agent. Going through a few tutorials but there is one question I don’t find a clear answer yet. And I am sure this is not a new question asked here.
What factor or parameters decides the frequency of calling CollectObservations. Is it decided by the frequency of action output generated by the Python side? or is it simply decided by the frequency of calling FixedUpdate()?
Thanks!
Collecting observations is done at every physics step or FixedUpdate() when using the CollectObservations() implementation. More explanation here - Observation & Sensors.
Decision requests can be made manually (ad hoc) or using the DecisionRequestor
component which automatically requests a decision over an interval (called a decision period). More explanation here - Actions.
To summarize, observations are gathered every physics step, actions are returned when requested or on an interval (1-n physics steps).
Is there a way to make the observations only collected at certain, set times? I am making a turn-based board game, and the state of the board doesn’t change that often. (I have another thread asking about this here.)
Looking at the Observation & Sensors documentation, it looks like using ISensors could work, and the VectorSensor could be used in place of CollectObservations. Then, if I understand it correctly, the Write() method is called to generate an observation. I don’t understand though, from looking at the documentation, how the Write() method is called or used (code samples would be helpful).
EDIT: Found a (potential) solution in this thread :