rasa/core/policies/embedding_policy.py
def _regularization_loss(self):
        # type: () -> Union[tf.Tensor, int]
        """Add regularization to the embed layer inside rnn cell."""

        if self.attn_after_rnn:
            return self.C2 * tf.add_n(
                [tf.nn.l2_loss(tf_var)
                 for tf_var in tf.trainable_variables()
                 if 'cell/out_layer/kernel' in tf_var.name]
            )
        else:
            return 0
Add regularization to the embed layer inside rnn cell.
Add regularization to the embed layer inside rnn cell.
Add regularization to the embed layer inside rnn cell .
def _regularization_loss(self):
        if self.attn_after_rnn:
            return self.C2 * tf.add_n(
                [tf.nn.l2_loss(tf_var)
                 for tf_var in tf.trainable_variables()
                 if 'cell/out_layer/kernel' in tf_var.name]
            )
        else:
            return 0
def _regularization_loss ( self ) : if self . attn_after_rnn : return self . C2 * tf . add_n ( [ tf . nn . l2_loss ( tf_var ) for tf_var in tf . trainable_variables ( ) if 'cell/out_layer/kernel' in tf_var . name ] ) else : return 0
Add regularization to the embed layer inside rnn cell.
Add regularization to the embed layer inside rnn cell .
# type: () -> Union[tf.Tensor, int] """Add regularization to the embed layer inside rnn cell."""
self