File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,10 @@ def plot_metric(metric,
79
79
plt .figure ()
80
80
plt .title (graph_title )
81
81
if line_num == 1 :
82
- plt .plot (batch_id , metric , line_style , line_label )
82
+ plt .plot (batch_id , metric , line_style , label = line_label )
83
83
else :
84
84
for i in range (line_num ):
85
- plt .plot (batch_id , metric [i ], line_style [i ], line_label [i ])
85
+ plt .plot (batch_id , metric [i ], line_style [i ], label = line_label [i ])
86
86
plt .xlabel ('batch' )
87
87
plt .ylabel (graph_title )
88
88
plt .legend ()
@@ -102,12 +102,12 @@ def main():
102
102
accuracy_sample = sample (accuracy , args .sample_rate )
103
103
104
104
plot_metric (loss_sample , batch_sample , 'loss' , line_label = 'loss' )
105
- plot_metric (accuracy_sample ,
106
- batch_sample ,
107
- 'accuracy' ,
108
- line_style = 'g- ' ,
109
- line_label = 'accuracy' )
110
-
105
+ plot_metric (
106
+ accuracy_sample ,
107
+ batch_sample ,
108
+ 'accuracy ' ,
109
+ line_style = 'g-' ,
110
+ line_label = 'accuracy' )
111
111
112
112
if __name__ == '__main__' :
113
113
main ()
You can’t perform that action at this time.
0 commit comments