Normalized observation values

I’ve read here and there that it’s generally good to keep values reported to VectorSensor from implementations of CollectObservations within the -1.0 to 1.0 range. I’m currently flaunting that advice and recording things naively such as:

sensor.AddObservation(transform.position);

where the position of the object can be anywhere from 0…5000 in x and z.

How badly am I hurting myself by using values like that? How would things improve if I were to find a way to normalize this sort of thing, in the most general sense?

Thanks.

Hi,

We have a hyperparameter called “normalize” https://github.com/Unity-Technologies/ml-agents/blob/master/config/trainer_config.yaml#L13 that will keep a running mean and standard deviation of the previous observations and normalize the observations automatically. However, this process is slow since the mean and standard deviation of the observations is constantly changing.
The best thing is to make all observations in the range -1 to 1.
If the observations are not normalized, the neural network could become unstable. With large weight values causing gradients as large that can put the neural network into an unrecoverable state.
Not normalizing could prevent learning completely.

2 Likes

That sounds pretty severe. Thanks for the clarification!