This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hierarchical lstm prediction for variable length

I have the hierarchical input data in format -

input_x  = [[1,2,11] , [0, 22, 33] , [0,44,10] , [9,1,32]]
target_x = [0.2 , 0.4 , 0.7 ,0.3]


Currently , I am implementing the below hierarchical seq model -

x = Input(shape=(**4**, 3,1)) encoded_rows = TimeDistributed(LSTM(row_hidden))(x) encoded_columns = LSTM(col_hidden)(encoded_rows) prediction = Dense(**4**, activation='softmax')(encoded_columns) model = Model(x, prediction) model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy']) 


The input len and output len (in dense layer) differs for all observations - the model can be trained for varied length inputs-outputs by using batches of different lengths.

Question is Can I use the trained models on dynamic lengths for predicting on varied length inputs for test data as well?

Thanks

Parents
  • I don't think there's enough context in here to be able to answer properly, I'm not entirely sure what you're trying to do. Is there a github or similar repository to point to, and maybe a little more on what and how you're trying to achieve?

Reply
  • I don't think there's enough context in here to be able to answer properly, I'm not entirely sure what you're trying to do. Is there a github or similar repository to point to, and maybe a little more on what and how you're trying to achieve?

Children
No data