This commit is contained in:
Andre Henriques 2023-10-25 14:50:58 +01:00
parent 0d4b8917d1
commit c00bd87cf7
2 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ tmp/
testData/
savedData/
!savedData/.keep
fyp

View File

@ -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)
}
}