Skip to content

Commit 5b62a38

Browse files
committed
Small update to lstm code. uidx have already been incremented
fix lisa-labgh-122
1 parent 0d80529 commit 5b62a38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/lstm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def train_lstm(
569569
f_update(lrate)
570570

571571
if numpy.isnan(cost) or numpy.isinf(cost):
572-
print 'NaN detected'
572+
print 'bad cost detected: ', cost
573573
return 1., 1., 1.
574574

575575
if numpy.mod(uidx, dispFreq) == 0:
@@ -595,7 +595,7 @@ def train_lstm(
595595

596596
history_errs.append([valid_err, test_err])
597597

598-
if (uidx == 0 or
598+
if (best_p is None or
599599
valid_err <= numpy.array(history_errs)[:,
600600
0].min()):
601601

0 commit comments

Comments
 (0)