Graph Keras训练历史对象
keras-hist-graph的Python项目详细描述
Keras历史图表
使用matplotlib
生成历史对象的简单图形。特别适用于jupyter
它将显示对于训练数据和验证数据的精度和损失。
它还将打印在训练期间达到的最大^ {EM1} $验证精度
安装
pip install keras-hist-graph
用法
需要keras
fromkeras_hist_graphimportplot_historyhistory=model.fit(x,y,...)plot_history(history)
参数
plot_history现在接受这些参数中的任何一个(以任何顺序)
argument | default | possible | details |
---|---|---|---|
fig_size | (10, 6) | (^{ | Indicates width and height of the resulting graph |
min_accuracy | 0.5 | ^{ | Minimum accuracy to graph (often we don't care if acuracy is below 50%) |
smooth_factor | 0.75 | ^{ | Zero to one, inclusive. Smooths out the curves by averaging previous points. Consider makeing smaller if number of epochs is small. |
start_epoch | 5 | integer >= 0 | Plot the history starting at this epoch. Useful since the first epochs can have very high loss that makes the later loss hard to analyze visually |
xkcd | True | ^{ | Whether to render in the XKCD style. You might need to render twice for all properties to update if you change the boolean after using the method before |
示例:
plot_history(history,fig_size=(11,8.5),min_accuracy=0.8,start_epoch=2,smooth_factor=0.1)
注释
这是一个沟通底层数据不精确性的好方法!