First reward for training, second reward for tensorboard to compare

Hi :slight_smile:
I got a bit of struggle with optimizing my learning algorithm. I cannot find any info about it so I asking you for help. I will try to explain it with a simple example.

I have an agent which learns how to balance a ball on top of a cube. There are rewarding methods in the learning algorithm which are using some variables from environment to create reward value. I want to check how adjusting these variables (for example adding only half of one variable value to reward value instead of the whole one) affects an effectiveness of the algorithm. The adjusting makes reward values different from each variant of the algorithm. There is my problem because I want to compare which variant of the algorithm is the best in certain task. Using tensorboard and looking at the reward values is pointless for me.

So here comes my question if there is some way to create something like “background reward” which would not be used by agent for learning but I could use it to compare the effectiveness of the algorithms in tensorboard? In the example I would want to look at value of how near the ball is to center of the cube as it would be an ideal behavior which I could use for comparison across the algorithms.

I hope it is understandable :roll_eyes:

You can send numerical values to tensorboard, using the stats recorder.
https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/api/Unity.MLAgents.StatsRecorder.html
This way you can track behaviour, like the position of the ball. Or you might calculate some ratio for cumulative rewards vs your reward variables, and send the result to tensorboard, in order to see how different values affect training performance.
https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/api/Unity.MLAgents.Agent.html#Unity_MLAgents_Agent_GetCumulativeReward

Thank you :slight_smile: That is exactly what I was looking for :smile: