import tensorflow as tf

            objectives.append((Objective(name, contra_loss, min, include, exclude)))
        elif name == 'reward' and config.r_loss == 'l2':
            pred = heads[name](features)
            l2_loss = tf.compat.v1.losses.mean_squared_error(target[name], pred)
            # l2_loss = tf.nn.l2_loss(pred - target[name])
            objectives.append((Objective(name, l2_loss, min, include, exclude)))
