burn 0.3.0

BURN: Burn Unstoppable Rusty Neurons
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::data::dataloader::Progress;

pub trait LearnerCallback<T, V>: Send {
    fn on_train_item(&mut self, _item: LearnerItem<T>) {}
    fn on_valid_item(&mut self, _item: LearnerItem<V>) {}
    fn on_train_end_epoch(&mut self, _epoch: usize) {}
    fn on_valid_end_epoch(&mut self, _epoch: usize) {}
}

#[derive(new)]
pub struct LearnerItem<T> {
    pub item: T,
    pub progress: Progress,
    pub epoch: usize,
    pub epoch_total: usize,
    pub iteration: usize,
}