Add mean KL divergence logging #24
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new metric,
mean_kl_divergence
, to the AMP PPO algorithm and its associated runner. The changes ensure that this metric is calculated, logged, and integrated into the training loop, providing additional insights into the divergence between policy and expert distributions.Updates to
amp_ppo.py
(Algorithm Enhancements):mean_kl_divergence
as a new variable to track the average KL divergence during training. This metric is updated incrementally during the mini-batch processing and normalized after all updates. [1] [2] [3]mean_kl_divergence
in the tuple returned by theupdate
method, ensuring it is accessible to the runner.Updates to
amp_on_policy_runner.py
(Runner Integration):update_run_name_with_sequence
method to unpack and use themean_kl_divergence
metric from the algorithm'supdate
method.log
method to recordmean_kl_divergence
in TensorBoard under the "Loss" category, providing visibility into this new metric during training.