From bcce2f6865fb9388c173e82e0025b44357a0eab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jules=20Franc=CC=A7oise?= Date: Fri, 22 Jul 2016 14:48:31 -0700 Subject: [PATCH] fix minor bugs for training in max objects --- src/core/model/xmmModel.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/model/xmmModel.hpp b/src/core/model/xmmModel.hpp index 985f4dc..e2aee2b 100644 --- a/src/core/model/xmmModel.hpp +++ b/src/core/model/xmmModel.hpp @@ -244,6 +244,7 @@ class Model : public Writable { virtual void train(TrainingSet* trainingSet) { if (!trainingSet) return; cancelTraining(); + clear(); is_training_ = true; @@ -445,8 +446,10 @@ class Model : public Writable { */ void fromJson(Json::Value const& root) { try { + EventGenerator _tmp_training_events(training_events); Model tmp(root); *this = tmp; + training_events = _tmp_training_events; } catch (JsonException& e) { throw e; }