nicodjimenez / lstm

Minimal, clean example of lstm neural network training in python, for learning purposes.
1.72k stars 654 forks source link

Nicer formatting for test.py output; PEP8 #22

Closed naught101 closed 6 years ago

naught101 commented 7 years ago

Tighter output for the test example - each iteration is on one line, and number are trimmed to a few siginificant figures.

Old:

cur iter: 98
y_pred[0] : -0.50034152006
y_pred[1] : 0.201122394088
y_pred[2] : 0.0990753171675
y_pred[3] : -0.499190430063
loss: 2.8868462645e-06
cur iter: 99
y_pred[0] : -0.500331437373
y_pred[1] : 0.201063161851
y_pred[2] : 0.0991220279374
y_pred[3] : -0.499225555158
loss: 2.61076361058e-06

New:

iter 98: y_pred = [-0.50034,  0.20112,  0.09908, -0.49919], loss: 2.887e-06
iter 99: y_pred = [-0.50033,  0.20106,  0.09912, -0.49923], loss: 2.611e-06

Also a couple of PEP8 clean ups.

ghost commented 7 years ago

Well done Cap!! :+1: