karpathy / char-rnn

Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch
11.59k stars 2.58k forks source link

Fix early stopping bug #85

Closed alexkruegger closed 9 years ago

alexkruegger commented 9 years ago

The var 'loss0' has been initialized only once at line (if loss0 == nil then loss0 = loss[1] end) so all next check had to use this first train_losses[1] value. This PR try to fix early stopping functionality.

karpathy commented 9 years ago

Thanks, but the way it is right now is the intended functionality. If we ever reach loss 3x greater than initial loss we halt out.