Why is the "lambda" required in the code below

Viewed 82

I am tying to implement a function that computes a mean squared error of two input vectors.

# 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?>

How should I run the graph given the structure above. Why is "lambda" needed to run the graph? usually, I would do the following:

mse.eval({vector1:dummy1,vector2:dummy2})
0 Answers
Related