bc6c691202e5f8755de7b13d88f86286ff878abb,kur/backend/pytorch_backend.py,PyTorchBackend,process_loss,#PyTorchBackend#Any#Any#,244
Before Change
"loss functions attached: %s", ", ".join(output_only))
if isinstance(loss, (list, tuple)):
loss = {x.get("target") : x for x in loss}
if not isinstance(loss, (dict, OrderedDict)):
raise ValueError("Loss functions given to "compile" should be "
"a list/tuple, a dictionary, or a single Loss instance. "
After Change
if isinstance(loss, (list, tuple)):
loss_with_names = []
for x in loss:
if not isinstance(x, (dict, OrderedDict)):
raise ValueError("Expected each individual loss entry to "
"be a dictionary. Received: {}".format(x))
if not "target" in x:
raise ValueError("Missing required key in loss function: "
""target".")
loss_with_names.append((x["target"], x))
elif isinstance(loss, (dict, OrderedDict)):
loss_with_names = list(loss.items())
else:
raise ValueError("Loss functions given to "compile" should be "
"a list/tuple, a dictionary, or a single Loss instance. "
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances Project Name: deepgram/kur
Commit Name: bc6c691202e5f8755de7b13d88f86286ff878abb
Time: 2017-05-10
Author: ajsyp@syptech.net
File Name: kur/backend/pytorch_backend.py
Class Name: PyTorchBackend
Method Name: process_loss
Project Name: markovmodel/PyEMMA
Commit Name: d58f782c5ed1e6e21035ec23012b54720f293503
Time: 2017-12-19
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/estimator.py
Class Name: Estimator
Method Name: __my_setstate__
Project Name: deepgram/kur
Commit Name: bc6c691202e5f8755de7b13d88f86286ff878abb
Time: 2017-05-10
Author: ajsyp@syptech.net
File Name: kur/backend/keras_backend.py
Class Name: KerasBackend
Method Name: process_loss