utils#
Source code: tianshou/trainer/utils.py
- test_episode(collector: BaseCollector, test_fn: Callable[[int, int | None], None] | None, epoch: int, n_episode: int, logger: BaseLogger | None = None, global_step: int | None = None, reward_metric: Callable[[ndarray], ndarray] | None = None) CollectStats[source]#
A simple wrapper of testing policy in collector.
- gather_info(start_time: float, policy_update_time: float, gradient_step: int, best_score: float, best_reward: float, best_reward_std: float, train_collector: BaseCollector | None = None, test_collector: BaseCollector | None = None) InfoStats[source]#
A simple wrapper of gathering information from collectors.
- Returns:
InfoStats object with times computed based on the start_time and episode/step counts read off the collectors. No computation of expensive statistics is done here.