我想实现一个计算两个输入向量的均方误差的函数。
# function has to take 2 vectors and return a single number
# <define_inputs_and_transformations()>
vector1 = tf.placeholder('float32',shape=(None,))
vector2 = tf.placeholder('float32',shape=(None,))
# mse =<define_transformation()>
mse = tf.reduce_mean(vector1 - vector2)**2
#compute_mse = lambda vector1, vector2: <how to run graph?>
鉴于上述结构,我应该如何运行该图。为什么需要“ lambda”来运行图形? 通常,我会执行以下操作:
mse.eval({vector1:dummy1,vector2:dummy2})