-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_weight_max.m
59 lines (46 loc) · 1.33 KB
/
plot_weight_max.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
close all;clear all;clc;
%% Path for Matlab functions
addpath ('functions/');
global path;
%path = '/home/philippe/robibio/grimmer_version/output';
path = '/media/philippe/Disk_12To/robibio';
global expe;
expe = 2;
global epoch;
epoch = 1;
global iter;
iter = 1;
weight = [];
max_weight = [];
fprintf("Preparing data...\n\n");
isEpoch = true;
while (isEpoch)
%dirname = sprintf('output/expe-%d/epoch-%d/iter-%d.mat', expe, epoch, iter);
dirname = sprintf('%s/expe-%d/epoch-%d/',path ,expe ,epoch);
if (exist(dirname, 'dir'))
isIter = true;
while (isIter)
filename = sprintf('%s/expe-%d/epoch-%d/iter-%d.mat', path, expe, epoch, iter);
if (isfile(filename))
load(filename);
%fprintf('Expe %d | Epoch %d | Iter %d | weight = %f kg\n', expe, epoch, iter, data.weight);
weight = [weight; data.weight];
max_weight = [max_weight; max(weight)];
iter = iter +1;
else
isIter = false;
% Next epoch
iter = 1;
epoch = epoch +1;
end
end
else
isEpoch = false;
end
end
figure; hold on;
plot (weight);
plot (max_weight);
grid on;
title ('Max Weight');
fprintf ("\nMax weight %.2f\n", max(max_weight));