Skip to content

Commit

Permalink
Combine everything related to maxent to a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu, Ke committed Dec 17, 2014
1 parent f2d50c3 commit bd9308e
Show file tree
Hide file tree
Showing 10 changed files with 516 additions and 556 deletions.
6 changes: 3 additions & 3 deletions decoder/ff_const_reorder_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ typedef std::unordered_map<std::string, int>::iterator Iterator;
struct Tsuruoka_Maxent {
Tsuruoka_Maxent(const char* pszModelFName) {
if (pszModelFName != NULL) {
m_pModel = new ME_Model();
m_pModel = new maxent::ME_Model();
m_pModel->load_from_file(pszModelFName);
} else
m_pModel = NULL;
Expand All @@ -1093,7 +1093,7 @@ struct Tsuruoka_Maxent {

void fnEval(const char* pszContext, std::vector<double>& vecOutput) const {
std::vector<std::string> vecContext;
ME_Sample* pmes = new ME_Sample();
maxent::ME_Sample* pmes = new maxent::ME_Sample();
SplitOnWhitespace(std::string(pszContext), &vecContext);

vecOutput.clear();
Expand All @@ -1113,7 +1113,7 @@ struct Tsuruoka_Maxent {
}

private:
ME_Model* m_pModel;
maxent::ME_Model* m_pModel;
};

// an argument item or a predicate item (the verb itself)
Expand Down
4 changes: 2 additions & 2 deletions training/const_reorder/trainer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void Tsuruoka_Maxent_Trainer::fnTrain(const char* pszInstanceFName,
strcmp(pszAlgorithm, "sgd") == 0 || strcmp(pszAlgorithm, "SGD") == 0);
FILE* fpIn = fopen(pszInstanceFName, "r");

ME_Model* pModel = new ME_Model();
maxent::ME_Model* pModel = new maxent::ME_Model();

char* pszLine = new char[100001];
int iNumInstances = 0;
Expand All @@ -30,7 +30,7 @@ void Tsuruoka_Maxent_Trainer::fnTrain(const char* pszInstanceFName,

iNumInstances++;

ME_Sample* pmes = new ME_Sample();
maxent::ME_Sample* pmes = new maxent::ME_Sample();

char* p = strrchr(pszLine, ' ');
assert(p != NULL);
Expand Down
5 changes: 0 additions & 5 deletions utils/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,15 @@ libutils_a_SOURCES = \
have_64_bits.h \
indices_after.h \
kernel_string_subseq.h \
lbfgs.h \
lbfgs.cpp \
logval.h \
m.h \
mathvec.h \
maxent.h \
maxent.cpp \
murmur_hash3.h \
murmur_hash3.cc \
named_enum.h \
null_deleter.h \
null_traits.h \
owlqn.cpp \
sgd.cpp \
perfect_hash.h \
prob.h \
sampler.h \
Expand Down
108 changes: 0 additions & 108 deletions utils/lbfgs.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions utils/lbfgs.h

This file was deleted.

87 changes: 0 additions & 87 deletions utils/mathvec.h

This file was deleted.

Loading

0 comments on commit bd9308e

Please sign in to comment.