4fe163020c387e88c860bac594cf898cab196591,thinc/base.py,Network,setup,#Network#,80

Before Change


    def setup(self, *args, **kwargs):
        self.ops.reserve(self.get_nr_weight(args, **kwargs))
        self.layers = [self.make_component(i, args, **kwargs)
                       for i in range(len(args))]

    def get_nr_weight(self, components, **kwargs):
        nr_weight = 0

After Change


        return self.layers[-1].output_shape

    def setup(self, *layers, **kwargs):
        for i, layer in enumerate(layers):
            if isinstance(layer, Model):
                self.layers.append(layer)
            else:
                self.layers.append(layer(**kwargs))
    
    def initialize_weights(self, x):
        self.params_data = self.ops.allocate_pool(self.nr_weight,
                             name=(self.name, "pool"))
        for layer in self.layers:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: 4fe163020c387e88c860bac594cf898cab196591
Time: 2016-12-26
Author: honnibal+gh@gmail.com
File Name: thinc/base.py
Class Name: Network
Method Name: setup


Project Name: stellargraph/stellargraph
Commit Name: 54596495ee3297a03b5d69caaac37ac64e9b6f9f
Time: 2019-01-09
Author: yuriy.tyshetskiy@data61.csiro.au
File Name: stellargraph/layer/graph_attention.py
Class Name: GAT
Method Name: __call__


Project Name: explosion/thinc
Commit Name: 74687cc0a418af49418a80a62144222453af489f
Time: 2017-01-02
Author: honnibal+gh@gmail.com
File Name: thinc/neural/base.py
Class Name: Model
Method Name: __init__