This commit is contained in:
Morvan Zhou
2017-06-11 15:49:22 +10:00
committed by Morvan Zhou
parent d6f7fbf4cf
commit 3fc6f4e4a0
3 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ for t in range(100):
pred_y = prediction.data.numpy().squeeze()
target_y = y.data.numpy()
plt.scatter(x.data.numpy()[:, 0], x.data.numpy()[:, 1], c=pred_y, s=100, lw=0, cmap='RdYlGn')
accuracy = sum(pred_y == target_y)/200
accuracy = sum(pred_y == target_y)/200.
plt.text(1.5, -4, 'Accuracy=%.2f' % accuracy, fontdict={'size': 20, 'color': 'red'})
plt.pause(0.1)