Okay, I found the answer in the other thread (Lesson 8 homework assignments - #63 by zaoyang). Simply replace
loss = metrics.mse(layer,targ)
with
loss = K.mean(metrics.mse(layer, targ))
That will return a single mean value instead of the whole matrix. ![]()