30567a8d317e862a72f8ad69563659d78d3c11c4,nussl/ml/train/closures.py,Closure,__init__,#Closure#,63

Before Change



        self.losses = []
        for key, val in loss_dictionary.items():
            if "class" in val:
                loss_class = getattr(loss, val["class"])
            else:
                loss_class = getattr(loss, key)
            weight = 1 if "weight" not in val else val["weight"]
            keys = loss_class.DEFAULT_KEYS if "keys" not in val else val["keys"]
            args = [] if "args" not in val else val["args"]
            kwargs = {} if "kwargs" not in val else val["kwargs"]

After Change


            loss_class = getattr(loss, _loss_name)
            weight = 1 if "weight" not in val else val["weight"]
            keys = loss_class.DEFAULT_KEYS if "keys" not in val else val["keys"]
            args = [] if "args" not in val else copy.deepcopy(val["args"])
            kwargs = {} if "kwargs" not in val else copy.deepcopy(val["kwargs"])
            if _loss_name in ["CombinationInvariantLoss", "PermutationInvariantLoss"]:
                args[0] = getattr(loss, args[0])()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: interactiveaudiolab/nussl
Commit Name: 30567a8d317e862a72f8ad69563659d78d3c11c4
Time: 2020-04-09
Author: prem@u.northwestern.edu
File Name: nussl/ml/train/closures.py
Class Name: Closure
Method Name: __init__


Project Name: gooofy/zamia-speech
Commit Name: 85861ea5c5320518267405bef050a0dab933e069
Time: 2018-02-17
Author: guenter@zamia.org
File Name: phone_gen.py
Class Name:
Method Name:


Project Name: david-abel/simple_rl
Commit Name: fcab3b11c0096803616af4956e49c59be6466d88
Time: 2018-09-07
Author: yagneshrevar@gmail.com
File Name: simple_rl/tasks/navigation/NavigationWorldMDP.py
Class Name: NavigationWorldMDP
Method Name: sample_trajectories