Skip to content

Commit

Permalink
[fix] use math.h for exp
Browse files Browse the repository at this point in the history
  • Loading branch information
endyul committed Aug 18, 2015
1 parent be9adfa commit bef6c44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/framework/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "utils/math/sparsevec.h"
#include "utils/math/featurevec.h"
#include "utils/logging.hpp"
#include "math.h"

namespace ltp {
namespace framework {
Expand Down Expand Up @@ -349,14 +350,14 @@ class ViterbiDecoderWithMarginal : public ViterbiDecoder {

for (int i = 0; i < L; ++ i) {
for (int t = 0; t < T; ++ t) {
exp_emit[i][t] = std::exp(scm.emit(i, t) / last_timestamp);
exp_emit[i][t] = exp(scm.emit(i, t) / last_timestamp);
}
}

exp_tran.resize(T, T);
for (int i = 0; i < T; ++ i) {
for (int j = 0; j < T; ++ j) {
exp_tran[i][j] = std::exp(scm.tran(i, j) / last_timestamp);
exp_tran[i][j] = exp(scm.tran(i, j) / last_timestamp);
}
}
}
Expand Down

0 comments on commit bef6c44

Please sign in to comment.