Red de conocimiento informático - Conocimiento informático - Cómo agregar regularización L2 a una capa

Cómo agregar regularización L2 a una capa

tf.nn.l2_loss() y tf.contrib.layer.l2_regularizer(), el uso de ejemplo es el siguiente:

importar tensorflow como tf

weights = tf.constant(, [4, 5, 6 ]], dtype=tf.float32)

sess = tf.l2_regularizer()