I'm using MLPs to forecast a time series, I implement a code that contain a mask layer to let the model skip the mask values.
for instance, in my data, the time series has a lot of NaN values, I fill it by a 'value = -999'. I don't want to remove it, but I want the Keras masking to skip it in gentle way.
My code as the following:
model = Sequential()
model.add(Masking(mask_value=-999, input_shape=(n_steps_in, )))
model.add(Dense(1024, activation='relu'))
model.add(Dense(n_steps_out))
I read an answer that said it is impossible to let masking works with MLPs.
How to add a mask layer for MLPs, or a custom mask layer to solve this problem?