allow passing model through Ritual init
This commit is contained in:
parent
fd2fc4bd76
commit
50e0311051
1 changed files with 3 additions and 1 deletions
|
@ -9,9 +9,11 @@ Losses = namedtuple("Losses", ["avg_loss", "avg_mloss", "losses", "mlosses"])
|
|||
|
||||
|
||||
class Ritual: # i'm just making up names at this point.
|
||||
def __init__(self, learner=None):
|
||||
def __init__(self, learner=None, model=None):
|
||||
self.learner = learner if learner is not None else Learner(Optimizer())
|
||||
self.model = None
|
||||
if model is not None:
|
||||
self.prepare(model)
|
||||
|
||||
def reset(self):
|
||||
self.learner.reset(optim=True)
|
||||
|
|
Loading…
Reference in a new issue