33#include " Doc2Vec.h"
44#include " NN.h"
55#include " Vocab.h"
6- #include " WMD.h"
6+ // #include "WMD.h"
77#include " TrainModelThread.h"
88#include " TaggedBrownCorpus.h"
99
@@ -17,7 +17,7 @@ void * trainModelThread(void * params)
1717}
1818
1919// ///==============================DOC2VEC========================
20- Doc2Vec::Doc2Vec (): m_word_vocab(NULL ), m_doc_vocab(NULL ), m_nn(NULL ), m_wmd(NULL ),
20+ Doc2Vec::Doc2Vec (): m_word_vocab(NULL ), m_doc_vocab(NULL ), m_nn(NULL ), // m_wmd(NULL),
2121 m_brown_corpus(NULL ), m_expTable(NULL ), m_negtive_sample_table(NULL )
2222{
2323 initExpTable ();
@@ -28,7 +28,7 @@ Doc2Vec::~Doc2Vec()
2828 if (m_word_vocab) delete m_word_vocab;
2929 if (m_doc_vocab) delete m_doc_vocab;
3030 if (m_nn) delete m_nn;
31- if (m_wmd) delete m_wmd;
31+ // if(m_wmd) delete m_wmd;
3232 if (m_brown_corpus) delete m_brown_corpus;
3333 if (m_expTable) free (m_expTable);
3434 if (m_negtive_sample_table) free (m_negtive_sample_table);
@@ -99,11 +99,11 @@ void Doc2Vec::train(const char * train_file,
9999 free (pt);
100100 if (m_trace > 0 ){
101101 std::time_t t = std::chrono::system_clock::to_time_t (std::chrono::system_clock::now ());
102- Rcpp::Rcout << Rcpp::as<Rcpp::Datetime>(Rcpp::wrap (t)) << " Closed all threads, normalising & WMD " << " \n " ;
102+ Rcpp::Rcout << Rcpp::as<Rcpp::Datetime>(Rcpp::wrap (t)) << " Closed all threads, normalising" << " \n " ;
103103 }
104104 m_nn->norm ();
105- m_wmd = new WMD (this );
106- m_wmd->train ();
105+ // m_wmd = new WMD(this);
106+ // m_wmd->train();
107107}
108108
109109void Doc2Vec::initTrainModelThreads (const char * train_file, int threads, int iter)
@@ -282,7 +282,7 @@ void Doc2Vec::save(FILE * fout)
282282 fwrite (&m_start_alpha, sizeof (real), 1 , fout);
283283 fwrite (&m_sample, sizeof (real), 1 , fout);
284284 fwrite (&m_iter, sizeof (int ), 1 , fout);
285- m_wmd->save (fout);
285+ // m_wmd->save(fout);
286286}
287287
288288void Doc2Vec::load (FILE * fin)
@@ -304,12 +304,12 @@ void Doc2Vec::load(FILE * fin)
304304 if (errnr <= 0 ) Rcpp::stop (" fread failed" );
305305 initNegTable ();
306306 m_nn->norm ();
307- m_wmd = new WMD (this );
308- m_wmd->load (fin);
307+ // m_wmd = new WMD(this);
308+ // m_wmd->load(fin);
309309}
310310
311311long long Doc2Vec::dim () {return m_nn->m_dim ;}
312- WMD * Doc2Vec::wmd () {return m_wmd;}
312+ // WMD * Doc2Vec::wmd() {return m_wmd;}
313313Vocabulary* Doc2Vec::wvocab () {return m_word_vocab;}
314314Vocabulary* Doc2Vec::dvocab () {return m_doc_vocab;}
315315NN * Doc2Vec::nn () {return m_nn;}
0 commit comments