MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / l2

Function l2

modelzoo/mmoe/train.py:102–105  ·  view source on GitHub ↗
(weights)

Source from the content-addressed store, hash-verified

100 return lambda _: None
101
102 def l2(weights):
103 with tf.name_scope(scope, 'l2_regularizer', [weights]) as name:
104 my_scale = tf.convert_to_tensor(scale, dtype=weights.dtype.base_dtype, name='scale')
105 return tf.math.multiply(my_scale, tf.nn.l2_loss(weights), name=name)
106
107 return l2
108

Callers

nothing calls this directly

Calls 2

multiplyMethod · 0.80
name_scopeMethod · 0.45

Tested by

no test coverage detected