ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

[Question] About "log_sigma_squared"

Open MengqiYe opened this issue 7 years ago • 4 comments

While reading code, I only found: log_sigma_sq = tf.get_variable("log_sigma_squared", [self.act_size[0]], dtype=tf.float32, initializer=tf.zeros_initializer()) How is this variable get calculated and assigned? Is it affected by optimizer BP process? Many thanks for your help.

MengqiYe avatar Apr 25 '19 03:04 MengqiYe

Hi @seaswander, this statement is creating a variable to represent the log of the variance for the action outputs of the policy. This is the continuous control case, and each action output is modeled by a gaussian with a given mean and stddev/variance. Then each action value is produced by generating a value from this distribution mean and standard deviation scaled by the epsilon parameter: https://github.com/Unity-Technologies/ml-agents/blob/2cccc2c9f337e36aef969122066b52002ee800da/ml-agents/mlagents/trainers/models.py#L286 The variable will be updated by the optimizer based on the loss.

harperj avatar Apr 25 '19 20:04 harperj

I think I've answered your question here, so I'm going to close this issue -- but please feel free to reopen or create a new issue if you run into any more problems.

harperj avatar Apr 25 '19 20:04 harperj

@harperj Thanks for your explanation!

MengqiYe avatar Apr 26 '19 00:04 MengqiYe

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Apr 25 '20 08:04 lock[bot]