📜  tf.reduce_mean(y_true,y_predicted) - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:35.647000             🧑  作者: Mango

代码示例1
with tf.name_scope("MSE"):
    y_true = tf.placeholder("float32", shape=(None,), name="y_true")
    y_predicted = tf.placeholder("float32", shape=(None,), name="y_predicted")
    # Your code goes here
    mse = tf.reduce_mean((y_predicted - y_true)**2)
    
def compute_mse(vector1, vector2):
    return mse.eval({y_true: vector1, y_predicted: vector2})