Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoder inputs are less than source_seq_len by 1 #57

Open
Ammola opened this issue Apr 13, 2019 · 1 comment
Open

Encoder inputs are less than source_seq_len by 1 #57

Ammola opened this issue Apr 13, 2019 · 1 comment
Labels

Comments

@Ammola
Copy link

Ammola commented Apr 13, 2019

Hi @una-dinosauria
I'm wondering why did you choose encoder_inputs to be less than source_seq_len by 1?
Line 453
While you choose decoder_outputs and decoder_inputs to be the same as target_seq_len.

def get_batch( self, data, actions ):
"""Get a random batch of data from the specified bucket, prepare for step.
Args
data: a list of sequences of size n-by-d to fit the model to.
actions: a list of the actions we are using
Returns
The tuple (encoder_inputs, decoder_inputs, decoder_outputs);
the constructed batches have the proper format to call step(...) later.
"""
# Select entries at random
all_keys = list(data.keys())
chosen_keys = np.random.choice( len(all_keys), self.batch_size )
# How many frames in total do we need?
total_frames = self.source_seq_len + self.target_seq_len
encoder_inputs = np.zeros((self.batch_size, self.source_seq_len-1, self.input_size), dtype=float)
decoder_inputs = np.zeros((self.batch_size, self.target_seq_len, self.input_size), dtype=float)
decoder_outputs = np.zeros((self.batch_size, self.target_seq_len, self.input_size), dtype=float)

@una-dinosauria
Copy link
Owner

Because the last frame of encoder_inputs is given as a seed to the decoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants