7deceb39597ea90e0f130448cf3616f0875b7f91,tensorforce/models/q_naf_model.py,QNAFModel,tf_regularization_losses,#QNAFModel#Any#Any#,93

Before Change


                if state_value.regularization_loss() is not None
            ])

        if any(l_entries.regularization_loss() is not None for l_entries in self.l_entries.values()):
            losses["l-entries"] = tf.add_n(inputs=[
                l_entries.regularization_loss() for l_entries in self.l_entries.values()
                if l_entries.regularization_loss() is not None
            ])

        return losses

    def get_variables(self, include_non_trainable=False):
        model_variables = super(QNAFModel, self).get_variables(include_non_trainable=include_non_trainable)

After Change


    def tf_regularization_losses(self, states, internals):
        losses = super(QNAFModel, self).tf_regularization_losses(states=states, internals=internals)

        for state_value in self.state_values.values():
            regularization_loss = state_value.regularization_loss()
            if regularization_loss is not None:
                if "state-values" in losses:
                    losses["state-values"] += regularization_loss
                else:
                    losses["state-values"] = regularization_loss

        for l_entries in self.l_entries.values():
            regularization_loss = l_entries.regularization_loss()
            if regularization_loss is not None:
                if "l-entries" in losses:
                    losses["l-entries"] += regularization_loss
                else:
                    losses["l-entries"] = regularization_loss
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 12

Instances


Project Name: reinforceio/tensorforce
Commit Name: 7deceb39597ea90e0f130448cf3616f0875b7f91
Time: 2017-10-28
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/q_naf_model.py
Class Name: QNAFModel
Method Name: tf_regularization_losses


Project Name: reinforceio/tensorforce
Commit Name: 0e6f7cea4abae753c8e496bbbe6465af6818ad92
Time: 2017-10-28
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/distribution_model.py
Class Name: DistributionModel
Method Name: tf_regularization_losses


Project Name: dPys/PyNets
Commit Name: a81256ff13130fa425080168e79f3a548a57e604
Time: 2020-12-26
Author: dpisner@utexas.edu
File Name: pynets/plotting/plot_graphs.py
Class Name:
Method Name: plot_community_conn_mat


Project Name: dPys/PyNets
Commit Name: a81256ff13130fa425080168e79f3a548a57e604
Time: 2020-12-26
Author: dpisner@utexas.edu
File Name: pynets/plotting/plot_graphs.py
Class Name:
Method Name: plot_conn_mat