fix case when no callbacks are given

This commit is contained in:
Connor Olding 2017-07-21 19:44:54 +00:00
parent 4a108a10ae
commit 217a19110a

5
onn.py
View file

@ -967,7 +967,7 @@ def ritual_from_config(config, learner, loss, mloss):
return ritual
def model_from_config(config, input_features, output_features, callbacks):
def model_from_config(config, input_features, output_features, callbacks=None):
init = inits[config.init]
activation = activations[config.activation]
@ -990,7 +990,8 @@ def model_from_config(config, input_features, output_features, callbacks):
optim = optim_from_config(config)
def rscb(restart):
callbacks.restart()
if callbacks:
callbacks.restart()
log("restarting", restart)
if config.restart_optim:
optim.reset()