Chainer extension module to output graph such as learning-curve.
trainer.extend(GraphReport('main/accuracy'))
With using postprocess
argument, you can customize the graph.
def postprocess(figure, axes, summary):
axes.set_xlabel('iteration')
axes.set_ylabel('accuracy')
axes.set_ylim((0, 1))
axes.legend(loc='best')
trainer.extend(GraphReport(('main/accuracy', 'validation/main/accuracy'),
trigger=(100, 'iteration'),
postprocess=postprocess,
file_name='accuracy.png'))
GraphReport(y_keys, x_key='iteration', trigger=(1, 'epoch'), postprocess=None, file_name='graph.png')
The value regarded as y axis.
The value regarded as x axis.
Trigger that decides when to aggregate the result and output the values.
You can specify a callback function to customize the figure. This callback function receive 3 paramters.
name | type |
---|---|
figure | matplotlib.Figure |
axes | matplotlib.Axes |
summary | dict |
The output file name.