我正在尝试在下面的 LSTM python 代码中进行绘图,但没有发生任何事情,我该怎么做才能修复它?(它只是最后的代码,lstm 代码可在deeplearning.com上获得)
print 'Train ', train_err, 'Valid ', valid_err, 'Test ', test_err
if saveto:
numpy.savez(saveto, train_err=train_err,
valid_err=valid_err, test_err=test_err,
history_errs=history_errs, **best_p)
print 'The code run for %d epochs, with %f sec/epochs' % (
(eidx + 1), (end_time - start_time) / (1. * (eidx + 1)))
print >> sys.stderr, ('Training took %.1fs' %
(end_time - start_time))
plt.plot(numpy.array(max_epochs), numpy.array(test_err), 'b-')
plt.xlabel('epochs')
plt.ylabel('error')
return train_err, valid_err, test_err
if __name__ == '__main__':
# See function train for all possible parameter and there definition.
train_lstm(
max_epochs=10,
test_size=500,
)