Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Improve the numerical stability
Browse files Browse the repository at this point in the history
  • Loading branch information
chiahuaho committed Jun 8, 2017
1 parent 9e4a1da commit 0271623
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ffm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,11 @@ ffm_model ffm_train_on_disk(string tr_path, string va_path, ffm_parameter param)

ffm_float r = param.normalization? prob.R[i] : 1;

ffm_float t = wTx(begin, end, r, model);
ffm_double t = wTx(begin, end, r, model);

ffm_float expnyt = exp(-y*t);
ffm_double expnyt = exp(-y*t);

loss += log(1+expnyt);
loss += log1p(expnyt);

if(do_update) {

Expand Down

0 comments on commit 0271623

Please sign in to comment.