Add "act" to preprocess_fn call in collector. (#801)
This allows, for instance, to change the action registered into the buffer when the environment modify the action. Useful in offline learning for instance, since the true actions are in a dataset and the actions of the agent are ignored. - [ ] I have marked all applicable categories: + [ ] exception-raising fix + [ ] algorithm implementation fix + [ ] documentation modification + [X] new feature - [X ] I have reformatted the code using `make format` (**required**) - [X] I have checked the code using `make commit-checks` (**required**) - [] If applicable, I have mentioned the relevant/related issue(s) - [X] If applicable, I have listed every items in this Pull Request below
This commit is contained in:
parent
774d3d8e83
commit
6019406cff
@ -347,6 +347,7 @@ class Collector(object):
|
|||||||
info=self.data.info,
|
info=self.data.info,
|
||||||
policy=self.data.policy,
|
policy=self.data.policy,
|
||||||
env_id=ready_env_ids,
|
env_id=ready_env_ids,
|
||||||
|
act=self.data.act,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -626,6 +627,7 @@ class AsyncCollector(Collector):
|
|||||||
truncated=self.data.truncated,
|
truncated=self.data.truncated,
|
||||||
info=self.data.info,
|
info=self.data.info,
|
||||||
env_id=ready_env_ids,
|
env_id=ready_env_ids,
|
||||||
|
act=self.data.act,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
@ -636,6 +638,7 @@ class AsyncCollector(Collector):
|
|||||||
done=self.data.done,
|
done=self.data.done,
|
||||||
info=self.data.info,
|
info=self.data.info,
|
||||||
env_id=ready_env_ids,
|
env_id=ready_env_ids,
|
||||||
|
act=self.data.act,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user