You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: qlib/model/trainer.py
+37-19Lines changed: 37 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
This is a concept called ``DelayTrainer``, which can be used in online simulating for parallel training.
9
9
In ``DelayTrainer``, the first step is only to save some necessary info to model recorders, and the second step which will be finished in the end can do some concurrent and time-consuming operations such as model fitting.
10
10
11
-
``Qlib`` offer two kinds of Trainer, ``TrainerR`` is the simplest way and ``TrainerRM`` is based on TaskManager to help manager tasks lifecycle automatically.
11
+
``Qlib`` offer two kinds of Trainer, ``TrainerR`` is the simplest way and ``TrainerRM`` is based on TaskManager to help manager tasks lifecycle automatically.
12
12
"""
13
13
14
14
importsocket
@@ -153,6 +153,9 @@ def is_delay(self) -> bool:
153
153
"""
154
154
returnself.delay
155
155
156
+
def__call__(self, *args, **kwargs) ->list:
157
+
returnself.end_train(self.train(*args, **kwargs))
158
+
156
159
157
160
classTrainerR(Trainer):
158
161
"""
@@ -286,19 +289,26 @@ class TrainerRM(Trainer):
286
289
# This tag is the _id in TaskManager to distinguish tasks.
0 commit comments