From c00bd87cf7d9d8f784280c38dcca99be1fe293ff Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Wed, 25 Oct 2023 14:50:58 +0100 Subject: [PATCH] closes #46 --- .gitignore | 1 + logic/models/train/train.go | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c4abeef..84e9a67 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ tmp/ testData/ savedData/ !savedData/.keep +fyp diff --git a/logic/models/train/train.go b/logic/models/train/train.go index f69591b..c471a73 100644 --- a/logic/models/train/train.go +++ b/logic/models/train/train.go @@ -19,7 +19,7 @@ import ( . "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils" ) -const EPOCH_PER_RUN = 1 +const EPOCH_PER_RUN = 20 const MAX_EPOCH = 100 func MakeDefenition(db *sql.DB, model_id string, target_accuracy int) (id string, err error) { @@ -324,7 +324,7 @@ func trainModel(c *Context, model *BaseModel) { break } - sort.Reverse(toRemove) + sort.Sort(sort.Reverse(toRemove)) c.Logger.Info("Round done", "toRemove", toRemove) @@ -342,7 +342,7 @@ func trainModel(c *Context, model *BaseModel) { continue } - sort.Reverse(definitions) + sort.Sort(sort.Reverse(definitions)) acc := definitions[0].acuracy - 20.0 @@ -357,9 +357,10 @@ func trainModel(c *Context, model *BaseModel) { c.Logger.Info("Removing due to accuracy", "toRemove", toRemove) - sort.Reverse(toRemove) + sort.Sort(sort.Reverse(toRemove)) for _, n := range toRemove { c.Logger.Warn("Removing definition not fast enough learning", "n", n) + ModelDefinitionUpdateStatus(c, definitions[n].id, MODEL_DEFINITION_STATUS_FAILED_TRAINING) definitions = remove(definitions, n) } }