burn_train/learner/rl/
output.rs1use crate::{
2 ItemLazy,
3 metric::{Adaptor, CumulativeRewardInput, EpisodeLengthInput},
4};
5
6pub struct EpisodeSummary {
8 pub episode_length: usize,
10 pub cum_reward: f64,
12}
13
14impl ItemLazy for EpisodeSummary {
15 type ItemSync = EpisodeSummary;
16
17 fn sync(self) -> Self::ItemSync {
18 self
19 }
20}
21
22impl Adaptor<EpisodeLengthInput> for EpisodeSummary {
23 fn adapt(&self) -> EpisodeLengthInput {
24 EpisodeLengthInput::new(self.episode_length as f64)
25 }
26}
27
28impl Adaptor<CumulativeRewardInput> for EpisodeSummary {
29 fn adapt(&self) -> CumulativeRewardInput {
30 CumulativeRewardInput::new(self.cum_reward)
31 }
32}