00de689e6624b4b3c312c921226ad23f49a79229,deeppavlov/core/models/keras_model.py,KerasModel,load,#KerasModel#,121
Before Change
"\nNetwork parameters are from %s_opt.json" % (self._model_file, self._model_file))
opt_path = Path(str(self.model_path) + "_opt.json")
weights_path = str(self.model_path) + ".h5"
if opt_path.is_file():
self.opt = read_json(opt_path)
else:
raise ConfigError(
"Error: config file %s_opt.json of saved model does not exist" % self._model_file)
model_func = getattr(self, model_name, None)
if callable(model_func):
model = model_func(params=self.opt)
else:
raise AttributeError("Model {} is not defined".format(model_name))
print("Loading weights from `{}{}`".format(self._model_file, ".h5"))
model.load_weights(weights_path)
optimizer_func = getattr(keras.optimizers, optimizer_name, None)
if callable(optimizer_func):
optimizer_ = optimizer_func(lr=lr, decay=decay)
After Change
model_func = getattr(self, model_name, None)
if callable(model_func):
model = model_func(params=self.opt)
else:
raise AttributeError("Model {} is not defined".format(model_name))
print("Loading weights from `{}{}`".format(self._model_file, ".h5"))
model.load_weights(weights_path)
optimizer_func = getattr(keras.optimizers, optimizer_name, None)
if callable(optimizer_func):
optimizer_ = optimizer_func(lr=lr, decay=decay)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 2
Instances
Project Name: deepmipt/DeepPavlov
Commit Name: 00de689e6624b4b3c312c921226ad23f49a79229
Time: 2018-01-19
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: load
Project Name: deepmipt/DeepPavlov
Commit Name: 00de689e6624b4b3c312c921226ad23f49a79229
Time: 2018-01-19
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: load
Project Name: keras-team/keras
Commit Name: 14ff5175181e680d75b8d4ad6fe0d7d4dd35beff
Time: 2018-05-17
Author: me@taehoonlee.com
File Name: keras/applications/nasnet.py
Class Name:
Method Name: NASNet