15a3a1f1ce2a7babf62c61f73709c074249ed840,keras/utils/layer_utils.py,,container_from_config,#Any#,18

Before Change


        // The case in which layer_dict represents an "atomic" layer
        layer_dict.pop("name")
        if "parameters" in layer_dict:
            params = layer_dict.get("parameters")
            layer_dict.pop("parameters")
            hasParams = True

        for k, v in layer_dict.items():
            // For now, this can only happen for regularizers and constraints
            if isinstance(v, dict):
                vname = v.get("name")
                v.pop("name")
                if vname in [x for x, y in inspect.getmembers(constraints, predicate=inspect.isclass)]:
                    layer_dict[k] = constraints.get(vname, v)
                if vname in [x for x, y in inspect.getmembers(regularizers, predicate=inspect.isclass)]:
                    layer_dict[k] = regularizers.get(vname, v)

        base_layer = get_layer(name, layer_dict)
        if hasParams:
            shaped_params = []
            for param in params:
                data = np.asarray(param.get("data"))
                shape = tuple(param.get("shape"))
                shaped_params.append(data.reshape(shape))
            base_layer.set_weights(shaped_params)
        return base_layer

After Change




def container_from_config(original_layer_dict):
    layer_dict = copy.deepcopy(original_layer_dict)
    name = layer_dict.get("name")

    if name == "Merge":
        mode = layer_dict.get("mode")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: 15a3a1f1ce2a7babf62c61f73709c074249ed840
Time: 2015-07-30
Author: francois.chollet@gmail.com
File Name: keras/utils/layer_utils.py
Class Name:
Method Name: container_from_config


Project Name: OpenMined/PySyft
Commit Name: 59d4bbaaf06850e2dfb357855f50b05f6c9aadb1
Time: 2020-10-02
Author: skywind29@users.noreply.github.com
File Name: syft/frameworks/torch/fl/utils.py
Class Name:
Method Name: scale_model


Project Name: keras-team/autokeras
Commit Name: 5b3af9ff43bc61f8034f1202a2b57f21c8ee3771
Time: 2018-08-01
Author: jin@tamu.edu
File Name: autokeras/graph.py
Class Name: Graph
Method Name: _insert_new_layers