00__00__00
00__00__00

Reputation: 5327

how does masking work in a recurrent model in keras?

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?

Upvotes: 2

Views: 1347

Answers (1)

Daniel Möller
Daniel Möller

Reputation: 86600

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

Upvotes: 1

Related Questions