f09b1d753bff6d85b32b52f01f4dee86511f3dbb,tensorforce/core/networks/layer.py,Linear,tf_regularization_losses,#Linear#,313

Before Change


        return x

    def tf_regularization_losses(self):
        if self.l2_regularization == 0.0:
            return super(Linear, self).tf_regularization_loss()

        if super(Linear, self).tf_regularization_loss() is None:
            losses = list()
        else:
            losses = [super(Linear, self).tf_regularization_loss()]

After Change


            if self.bias is not None:
                losses.append(self.l1_regularization * tf.reduce_sum(input_tensor=tf.abs(x=self.bias)))

        if len(losses) > 0:
            return tf.add_n(inputs=losses)
        else:
            return None


class Dense(Layer):
    
    Dense layer, i.e. linear fully connected layer with subsequent non-linearity.
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: reinforceio/tensorforce
Commit Name: f09b1d753bff6d85b32b52f01f4dee86511f3dbb
Time: 2017-10-21
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/core/networks/layer.py
Class Name: Linear
Method Name: tf_regularization_losses


Project Name: jhfjhfj1/autokeras
Commit Name: a6819ac67444b66143ab8e0cad8a42cb7635730d
Time: 2020-07-17
Author: haifengj@google.com
File Name: autokeras/blocks/basic.py
Class Name: ResNetBlock
Method Name: build


Project Name: reinforceio/tensorforce
Commit Name: f09b1d753bff6d85b32b52f01f4dee86511f3dbb
Time: 2017-10-21
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/core/networks/layer.py
Class Name: Conv2d
Method Name: tf_regularization_loss