JonathanRaiman / theano_lstm

:microscope: Nano size Theano LSTM module
Other
304 stars 111 forks source link

Question in Example Code #17

Open shyamupa opened 9 years ago

shyamupa commented 9 years ago

I am new to theano, so maybe my question does not make any sense. In the example here, in the create_prediction function,

if greedy:
            outputs_info = [dict(initial=self.priming_word, taps=[-1])] + [initial_state_with_taps(layer) for layer in self.model.layers[1:-1]]
            result, _ = theano.scan(fn=step,
                                n_steps=200,
                                outputs_info=outputs_info)
else:
            outputs_info = [initial_state_with_taps(layer, num_examples) for layer in self.model.layers[1:]]
            result, _ = theano.scan(fn=step,
                                    sequences=[inputs.T], # slice over each time step, so step fn. gets a sentence 
                                outputs_info=outputs_info)

why did you choose n_steps to be 200 for greedy? from what I understand it should be the same as the length of the longest sentence(because you padded things in the input matrix)