- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 50288 个
- 通用积分
- 83.6306
- 学术水平
- 253 点
- 热心指数
- 300 点
- 信用等级
- 208 点
- 经验
- 41518 点
- 帖子
- 3256
- 精华
- 14
- 在线时间
- 766 小时
- 注册时间
- 2006-5-4
- 最后登录
- 2022-11-6
|
|
- # Compute the moving average loss to smooth out the noise in SGD
- plotdata["avgloss"] = moving_average(plotdata["loss"])
- plotdata["avgerror"] = moving_average(plotdata["error"])
- # Plot the training loss and the training error
- import matplotlib.pyplot as plt
- plt.figure(1)
- plt.subplot(211)
- plt.plot(plotdata["batchsize"], plotdata["avgloss"], 'b--')
- plt.xlabel('Minibatch number')
- plt.ylabel('Loss')
- plt.title('Minibatch run vs. Training loss')
- plt.show()
- plt.subplot(212)
- plt.plot(plotdata["batchsize"], plotdata["avgerror"], 'r--')
- plt.xlabel('Minibatch number')
- plt.ylabel('Label Prediction Error')
- plt.title('Minibatch run vs. Label Prediction Error')
- plt.show()
复制代码
|
|