Skip to content

Question about Keras version #3

Description

@nhattan214

Hi Dr. Vadim,

In your Keras example, the CancelOut loss does not contain the variance term
def call(self, inputs):
if self.cancelout_loss:
self.add_loss( self.lambda_1 * tf.norm(self.w, ord=1) + self.lambda_2 * tf.norm(self.w, ord=2))
return tf.math.multiply(inputs, self.activation(self.w))
May I ask why we need to sum up the L1-norm and L2-norm of the weight here?
Also, in your Pytorch notebook, it is mentioned that the variance term is optional. So we can set that term to 0?

Regards,
Tan

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions