tensorflow 设置l2正则loss l2_loss = tf.add_n([tf.nn.l2_loss(var) for var in tf.trainable_variables() if 'weight' in var.name])