2

I found a nicely trained LSTM-based network. The network allows for masking.

for l in range(len(model.layers)):
    d=model.layers[l].__dict__
    print(d['supports_masking'])
    print(d['name'])

is True for me for all the 'name' beside the input layers.

I also have a time serie with missing timestamps, which I replace by the correct mask_value.

Is the network using all the masked_values as other ordinary values to determine the final prediction, so all the computation of the forward pass are actually executed (example update of the state in an LSTM for each timestamp in input) or the masked samples are completely skipped so the computation never take places?

Engineero
  • 12,340
  • 5
  • 53
  • 75
00__00__00
  • 4,834
  • 9
  • 41
  • 89

1 Answers1

1

Keras will skip time steps, as said in the documentation.

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214
  • 1
    thanks. ok but then if I have an observation which has at every timestamp the same value as mask_value (for any reason) then no prediction can be made?e.g. speed time series, it is fundamentally different for me if I have all missing or null readings – 00__00__00 Oct 11 '17 at 19:42
  • 4
    You shouldn't be using a mask value that is present in your data. Select a value that is used exclusively for that purpose. `-10000`, for instance. – Daniel Möller Oct 11 '17 at 20:11