Ejemplo n.º 1
0
 def train_online(self, *args, **kwargs):
     results = super().train_online(*args, **kwargs)
     if results is not None:
         results = save_weights_to_buffer(results)
     return results
Ejemplo n.º 2
0
 def __init__(self, model):
     buf = save_weights_to_buffer(model)
     self.cls, self.args, state = list(model.__reduce__())
     self.state = ray.put(buf)
Ejemplo n.º 3
0
 def train(self, *args, **kwargs):
     results = super().train(*args, **kwargs)
     if results is not None:
         model, *stats = results
         results = (save_weights_to_buffer(model), *stats)
     return results
Ejemplo n.º 4
0
 def __init__(self, model: ECD):
     buf = save_weights_to_buffer(model)
     self.cls = type(model)
     self.args = model.get_args()
     self.state = ray.put(buf)