Skip to content

Commit

Permalink
remove log_stream / only update atomic loss_ if verbose > 1
Browse files Browse the repository at this point in the history
Summary: See title.

Reviewed By: kahne

Differential Revision: D6596984

fbshipit-source-id: 7d9520acd21b825b617d5e2648d713f9e805d017
  • Loading branch information
cpuhrsch authored and facebook-github-bot committed Dec 18, 2017
1 parent d647be0 commit f138f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/fasttext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,12 @@ void FastText::trainThread(int32_t threadId) {
if (localTokenCount > args_->lrUpdateRate) {
tokenCount_ += localTokenCount;
localTokenCount = 0;
if (threadId == 0) loss_ = model.getLoss();
if (threadId == 0 && args_->verbose > 1)
loss_ = model.getLoss();
}
}
if (threadId == 0)
loss_ = model.getLoss();
ifs.close();
}

Expand Down
2 changes: 1 addition & 1 deletion src/fasttext.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FastText {
void saveModel();
void loadModel(std::istream&);
void loadModel(const std::string&);
void printInfo(real, real, std::ostream& log_stream);
void printInfo(real, real, std::ostream&);

void supervised(
Model&,
Expand Down

0 comments on commit f138f3a

Please sign in to comment.