File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
#include < string>
15
15
#include < vector>
16
+ #include < cmath>
16
17
17
18
#include " faster-rnnlm/hierarchical_softmax.h"
18
19
#include " faster-rnnlm/layers/interface.h"
@@ -445,9 +446,9 @@ void TrainLM(
445
446
}
446
447
447
448
Real ratio = bl_entropy / entropy;
448
- if (isnan (entropy) || isinf (entropy) || !(ratio >= bad_ratio)) {
449
+ if (std:: isnan (entropy) || std:: isinf (entropy) || !(ratio >= bad_ratio)) {
449
450
// !(ratio >= bad_ratio) will catch nan and inf even in fastmath mode
450
- if (isnan (entropy) || isinf (entropy) || !(ratio >= awful_ratio)) {
451
+ if (std:: isnan (entropy) || std:: isinf (entropy) || !(ratio >= awful_ratio)) {
451
452
fprintf (stderr, " \t Awful: Nnet rejected" );
452
453
nnet->ReLoad (model_weight_file);
453
454
} else {
You can’t perform that action at this time.
0 commit comments