d1dfcc0b80c4ecead8866473e5cfdfd351ac7cbd,kur/backend/pytorch_backend.py,PyTorchBackend,process_loss,#PyTorchBackend#Any#Any#,244
Before Change
if isinstance(loss, Loss):
loss = [loss]
if len(loss) != len(model.outputs):
raise ValueError("Model has {} outputs, but only {} loss "
"functions were specified."
.format(len(model.outputs), len(loss)))
if isinstance(loss, (list, tuple)):
loss = dict(zip(model.outputs, loss))
if not isinstance(loss, (dict, OrderedDict)):
After 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. "
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances Project Name: deepgram/kur
Commit Name: d1dfcc0b80c4ecead8866473e5cfdfd351ac7cbd
Time: 2017-05-10
Author: ajsyp@syptech.net
File Name: kur/backend/pytorch_backend.py
Class Name: PyTorchBackend
Method Name: process_loss
Project Name: deepgram/kur
Commit Name: d1dfcc0b80c4ecead8866473e5cfdfd351ac7cbd
Time: 2017-05-10
Author: ajsyp@syptech.net
File Name: kur/backend/keras_backend.py
Class Name: KerasBackend
Method Name: process_loss
Project Name: vatlab/SoS
Commit Name: cff40f037d2e805338ce0997f77424db723c9cc5
Time: 2017-02-13
Author: ben.bog@gmail.com
File Name: sos/remote.py
Class Name: RemoteHost
Method Name: receive_from_host