From 095a37189db9b77d10499a586791bf6b1409b97d Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Sun, 14 Apr 2024 16:51:15 +0100 Subject: [PATCH] fix the retrain model to eager closes #78 --- logic/models/train/train.go | 4 ++-- views/py/python_model_template_expand.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/logic/models/train/train.go b/logic/models/train/train.go index b6ad695..31e8595 100644 --- a/logic/models/train/train.go +++ b/logic/models/train/train.go @@ -350,7 +350,7 @@ func generateCvsExpandExp(c *Context, run_path string, model_id string, offset i return } if file_path == "id://" { - f.Write([]byte(id + "," + strconv.Itoa(-1) + "\n")) + f.Write([]byte(id + "," + strconv.Itoa(-2) + "\n")) } else { return count, errors.New("TODO generateCvs to file_path " + file_path) } @@ -529,7 +529,7 @@ func trainDefinitionExpandExp(c *Context, model *BaseModel, definition_id string if err != nil { return } - + os.RemoveAll(run_path) c.Logger.Info("Model finished training!", "accuracy", accuracy) return diff --git a/views/py/python_model_template_expand.py b/views/py/python_model_template_expand.py index 35127eb..4f67657 100644 --- a/views/py/python_model_template_expand.py +++ b/views/py/python_model_template_expand.py @@ -49,7 +49,7 @@ def pathToLabel(path): num = table.lookup(tf.strings.as_string([path])) return tf.cond( - tf.math.equal(num, tf.constant(-1)), + tf.math.equal(num, tf.constant(-2)), lambda: tf.zeros([depth]), lambda: tf.one_hot(table.lookup(tf.strings.as_string([path])) - diff, depth)[0] )