closes #46
This commit is contained in:
parent
0d4b8917d1
commit
c00bd87cf7
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ tmp/
|
|||||||
testData/
|
testData/
|
||||||
savedData/
|
savedData/
|
||||||
!savedData/.keep
|
!savedData/.keep
|
||||||
|
fyp
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
|
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const EPOCH_PER_RUN = 1
|
const EPOCH_PER_RUN = 20
|
||||||
const MAX_EPOCH = 100
|
const MAX_EPOCH = 100
|
||||||
|
|
||||||
func MakeDefenition(db *sql.DB, model_id string, target_accuracy int) (id string, err error) {
|
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
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Reverse(toRemove)
|
sort.Sort(sort.Reverse(toRemove))
|
||||||
|
|
||||||
c.Logger.Info("Round done", "toRemove", toRemove)
|
c.Logger.Info("Round done", "toRemove", toRemove)
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ func trainModel(c *Context, model *BaseModel) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Reverse(definitions)
|
sort.Sort(sort.Reverse(definitions))
|
||||||
|
|
||||||
acc := definitions[0].acuracy - 20.0
|
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)
|
c.Logger.Info("Removing due to accuracy", "toRemove", toRemove)
|
||||||
|
|
||||||
sort.Reverse(toRemove)
|
sort.Sort(sort.Reverse(toRemove))
|
||||||
for _, n := range toRemove {
|
for _, n := range toRemove {
|
||||||
c.Logger.Warn("Removing definition not fast enough learning", "n", n)
|
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)
|
definitions = remove(definitions, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user