Closed Twolige closed 2 years ago
Hi @Twolige,
The function that I use to visualise the attention matrix is here:
If you want to use sb3_highway_ppo_transformer.py
, you will have to copy and call this function from the script, but it will also require some adaptation. In particular, the code for getting the attention matrix from the SB3 model must be changed (it was done there with my own agent implementation:
once you have the attention matrix, you have to map its rows to the actual Vehicle objects in the scene as done here:
and then use display_vehicles_attention
to draw the lines on the simulation surface (env.unwrapped.viewer.sim_surface
)
Okay, maybe it is a bit tricky, I'll try to do it when I have a few spare minutes
Hi @eleurent, thanks for your work!
Nowadays I'm training an agent with the _sb3_highway_ppotransformer.py and just wonder,
Thanks for replying in advance.