train/train.rs
1use std::thread;
2use std::time::Duration;
3
4use avance::*;
5
6fn main() {
7 // Suppose we're training a model and here's 200 epoches
8 let epoch = 200;
9 let mut accuracy = 30.0;
10
11 (0..epoch)
12 .avance()
13 .with_style(Style::Block)
14 .with_pb()
15 .for_each(|(_, pb)| {
16 thread::sleep(Duration::from_millis(20));
17
18 accuracy += 0.34;
19
20 // Display the accuracy through the postfix
21 pb.set_postfix(format!("acc={:.2}", accuracy));
22 });
23}