Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy
- from keras.models import Model
- from keras.layers import Input, Dropout, TimeDistributed
- batch_size = 10
- timesteps = 5
- nb_features = 7
- dropout = 0.5
- input = Input(batch_shape=(batch_size, timesteps, nb_features))
- a = input
- a = TimeDistributed(Dropout(dropout))(a) # gives error
- output = a
- model = Model(input, output)
- model.compile("adam", "mse")
- X = numpy.random.rand(batch_size, timesteps, nb_features)
- Y = model.predict_on_batch(X)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement