diff options
author | Matthew Hoffman <matt@fiordilatte.local> | 2010-12-05 02:43:06 +0300 |
---|---|---|
committer | Matthew Hoffman <matt@fiordilatte.local> | 2010-12-05 02:43:06 +0300 |
commit | 2281feea57f3a2d213c6fd5323b71e29092dcfe0 (patch) | |
tree | 5e8b75ee7d5ea2726e8c1ff0ff91cfd2a7544c80 /parse_regressor.cc | |
parent | 4c4d630390fe791e97cca5bb6bc76d39a9587986 (diff) |
fixed bugs in the minibatch code---may still not work
Diffstat (limited to 'parse_regressor.cc')
-rw-r--r-- | parse_regressor.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/parse_regressor.cc b/parse_regressor.cc index 8f7d54bc..4fd1456e 100644 --- a/parse_regressor.cc +++ b/parse_regressor.cc @@ -36,9 +36,7 @@ void initialize_regressor(regressor &r) r.weight_vectors[i][j] = global.initial_weight; if (global.random_weights) for (size_t j = 0; j < length/num_threads; j++) { - r.weight_vectors[i][j] = -log(drand48()); - r.weight_vectors[i][j] *= r.weight_vectors[i][j]; - r.weight_vectors[i][j] *= r.weight_vectors[i][j]; + r.weight_vectors[i][j] = drand48() - 0.5; } if (global.lda) { @@ -46,9 +44,13 @@ void initialize_regressor(regressor &r) for (size_t j = 0; j < stride*length/num_threads; j+=stride) { - for (size_t k = 0; k < global.lda; k++) + for (size_t k = 0; k < global.lda; k++) { + r.weight_vectors[i][j+k] = -log(drand48()); + r.weight_vectors[i][j+k] *= r.weight_vectors[i][j+k]; + r.weight_vectors[i][j+k] *= r.weight_vectors[i][j+k]; r.weight_vectors[i][j+k] *= (float)global.lda_D / (float)global.lda / global.length() * 200; + } r.weight_vectors[i][j+global.lda] = global.initial_t; } } |