I work with time series data, taking 60 predicted days ahead.
I am currently using the standard error as my loss function and poor results
I want to implement a weighted mean square error, so early outputs are much more important than later ones.
Weighted average square root formula:

So, I need a way to iterate over tensor elements with an index (since I need to name both predicted and true values at the same time, then write the results to the tensor with only one element. 'Both (?, 60), but really (1, 60) lists.
And I'm not trying to work anything. Here is the code for the broken version
def weighted_mse(y_true,y_pred):
wmse = K.cast(0.0,'float')
size = K.shape(y_true)[0]
for i in range(0,K.eval(size)):
wmse += 1/(i+1)*K.square((y_true[i]-y_pred)[i])
wmse /= K.eval(size)
return wmse
I am currently getting this error:
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'dense_2_target' with dtype float
[[Node: dense_2_target = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
, , , , .