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

Before Change


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

        if any(state_value.regularization_loss() is not None for state_value in self.state_values.values()):
            losses["state-values"] = tf.add_n(inputs=[
                state_value.regularization_loss() for state_value in self.state_values.values()
                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

After Change


        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:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

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: sony/nnabla
Commit Name: dd0ee4e2e8c9bd08d1f4300ce6d92d798beaa1b1
Time: 2020-06-22
Author: 46014028+TE-ShiyuYang@users.noreply.github.com
File Name: python/src/nnabla/utils/load.py
Class Name:
Method Name: load


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