eleurent / rl-agents

Implementations of Reinforcement Learning and Planning algorithms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log: agent statistics

siddahant opened this issue · comments

Is there any method to log the agent statistics i.e collision, agent speed, travel distance, lane change, etc?

Hi,
No, as of now there is unfortunately no method for that.

After every environment step, you can read the info field which contains some of these features (collision, agent speed...), but the other features (travel distance, lane changes) and statistics aggregations still need to be implemented.

Hi @eleurent Is it possible to log the info to Callback like https://stable-baselines3.readthedocs.io/en/master/guide/callbacks.html to access some specific info in the Tensorboard.

By default, we can only see the logger log episodes and score only for HighwayEnv.

Or in the evaluation , can we log the info for each step on each episode?
It is much better than I can get the data to compute average_score in one episode.

Thanks,

Hey, I agree that this would be a nice feature.
I guess the simplest thing we could do would be to pass the Evaluation a callback_fn which would take the e.g. env, agent, writer, and step_result=(obs,reward,terminal,truncated,info) as arguments, and which would be called after every step. And the user could implement whatever callback they want, such as [writer.add_scalar(k, v) for k, v in step_result.info.items()]