Closed liamquantrill closed 5 months ago
Hello, what is your usecase? if you want to access all metrics, you might need to define a custom logger class. You don't see the rest of the metrics because they are flushed from the buffer just after being defined: https://github.com/DLR-RM/stable-baselines3/blob/5623d98f9d6bcfd2ab450e850c3f7b090aef5642/stable_baselines3/common/on_policy_algorithm.py#L274
❓ Question
I am trying to use the Logger along with a custom callback to access the metrics listed at the top of the linked Logger docs.
I am taking inspiration from here and am able to access the train/ metrics, but cannot access the eval/, time/, or rollout/ ones.
Here is the code I am using:
When run,
print(self.logger.name_to_value.items())
prints:dict_items([('train/learning_rate', 0.0003), ('train/entropy_loss', -0.6860671075060963), ('train/policy_gradient_loss', -0.017777339619351552), ('train/value_loss', 49.98345133364201), ('train/approx_kl', 0.008931432), ('train/clip_fraction', 0.10546875), ('train/loss', 6.665966510772705), ('train/explained_variance', -0.01795327663421631), ('train/n_updates', 10), ('train/clip_range', 0.2)])
And
for metric_name, value in self.metrics.items(): print(metric_name, value)
prints:As you can see, this only includes the train/ metrics. Please could somebody explain why this is so?
Checklist