draw_histo/
draw_histo.rs

1use tensorboard_rs::summary_writer::SummaryWriter;
2//use image::{open, };
3
4pub fn main() {
5
6    let mut writer = SummaryWriter::new(&("./logdir".to_string()));
7
8    let min = 1.001;
9    let max = 29.001;
10    let num = 435.;
11    let sum = 8555.435;
12    let sum_squares = 189242.110435;
13    let bucket_limits = [3.8009999999999997, 6.600999999999999, 9.400999999999998, 12.200999999999999, 15.001, 17.801, 20.601, 23.401, 26.201, 29.001];
14    let bucket_counts = [ 6., 15., 24., 33., 27., 48., 57., 66., 75., 84.];
15    
16    writer.add_histogram_raw("run1/histo1",
17                             min, max,
18                             num,
19                             sum, sum_squares,
20                             &bucket_limits, &bucket_counts,
21                             1
22    );
23
24    writer.add_histogram_raw("run1/histo1",
25                             min, max,
26                             num,
27                             sum, sum_squares,
28                             &bucket_limits, &bucket_counts,
29                             2
30    );
31
32    writer.add_histogram_raw("run1/histo1",
33                             min, max,
34                             num,
35                             sum, sum_squares,
36                             &bucket_limits, &bucket_counts,
37                             3
38    );
39    writer.flush();
40}