From 661466cf60dd1889df487e19ef0c778b3ee008e6 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Thu, 5 Dec 2019 13:03:01 +0100 Subject: [PATCH] initialised training module --- src/modules/training.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/modules/training.py diff --git a/src/modules/training.py b/src/modules/training.py new file mode 100644 index 00000000..8ef3138a --- /dev/null +++ b/src/modules/training.py @@ -0,0 +1,19 @@ +__author__ = "Lukas Leufen" +__date__ = '2019-12-05' + + +from src.modules.run_environment import RunEnvironment + + +class Training(RunEnvironment): + + def __init__(self): + super().__init__() + self.model = self.data_store.get("model", "general.model") + + def make_predict_function(self): + # create the predict function before distributing. This is necessary, because tf will compile the predict + # function just in the moment it is used the first time. This can cause problems, if the model is distributed + # on different workers. To prevent this, the function is pre-compiled. See discussion @ + # https://stackoverflow.com/questions/40850089/is-keras-thread-safe/43393252#43393252 + self.model._make_predict_function() \ No newline at end of file -- GitLab