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

Commit

Permalink
fix overflow when model size > 2^31
Browse files Browse the repository at this point in the history
  • Loading branch information
ycjuan committed Nov 14, 2017
1 parent 26c13b2 commit 7db5b4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ffm-train.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ string train_help() {
"-r <eta>: set learning rate (default 0.2)\n"
"-s <nr_threads>: set number of threads (default 1)\n"
"-p <path>: set path to the validation set\n"
"--quiet: quiet model (no output)\n"
"--quiet: quiet mode (no output)\n"
"--no-norm: disable instance-wise normalization\n"
"--auto-stop: stop at the iteration that achieves the best validation loss (must be used with -p)\n");
}
Expand Down
10 changes: 5 additions & 5 deletions ffm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ inline ffm_float wTx(
if(j2 >= model.n || f2 >= model.m)
continue;

ffm_float *w1_base = model.W + j1*align1 + f2*align0;
ffm_float *w2_base = model.W + j2*align1 + f1*align0;
ffm_float *w1_base = model.W + (ffm_long)j1*align1 + f2*align0;
ffm_float *w2_base = model.W + (ffm_long)j2*align1 + f1*align0;

__m128 XMMv = _mm_set1_ps(v1*v2*r);

Expand Down Expand Up @@ -206,8 +206,8 @@ inline ffm_float wTx(
if(j2 >= model.n || f2 >= model.m)
continue;

ffm_float *w1 = model.W + j1*align1 + f2*align0;
ffm_float *w2 = model.W + j2*align1 + f1*align0;
ffm_float *w1 = model.W + (ffm_long)j1*align1 + f2*align0;
ffm_float *w2 = model.W + (ffm_long)j2*align1 + f1*align0;

ffm_float v = v1 * v2 * r;

Expand Down Expand Up @@ -516,7 +516,7 @@ void ffm_read_problem_to_disk(string txt_path, string bin_path) {

Timer timer;

cout << "First check if the text file has already converted to binary format " << flush;
cout << "First check if the text file has already been converted to binary format " << flush;
bool same_file = check_same_txt_bin(txt_path, bin_path);
cout << "(" << fixed << setprecision(1) << timer.toc() << " seconds)" << endl;

Expand Down

0 comments on commit 7db5b4f

Please sign in to comment.