Skip to content

Commit

Permalink
fix minor bugs for training in max objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules Françoise committed Jul 22, 2016
1 parent 211c77e commit bcce2f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/model/xmmModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class Model : public Writable {
virtual void train(TrainingSet* trainingSet) {
if (!trainingSet) return;
cancelTraining();
clear();

is_training_ = true;

Expand Down Expand Up @@ -445,8 +446,10 @@ class Model : public Writable {
*/
void fromJson(Json::Value const& root) {
try {
EventGenerator<TrainingEvent> _tmp_training_events(training_events);
Model<SingleClassModel, ModelType> tmp(root);
*this = tmp;
training_events = _tmp_training_events;
} catch (JsonException& e) {
throw e;
}
Expand Down

0 comments on commit bcce2f6

Please sign in to comment.