Week 1 Assignment 2 Dino Name Exercise

Hello, I do not understand what’s wrong with my code. Is the implementation of Y the source of error? The model is not optimizing. Please help, thanks so much.

Hi @fireping668 ,

The problem is with Y wrongly constructed. Here is the implementation notes on how to construct Y:

Set the list of labels (integer representation of the characters): Y
  • The goal is to train the RNN to predict the next letter in the name, so the labels are the list of characters that are one time-step ahead of the characters in the input X .
    • For example, Y[0] contains the same value as X[1]
  • The RNN should predict a newline at the last letter, so add ix_newline to the end of the labels.
    • Append the integer representation of the newline character to the end of Y .
    • Note that append is an in-place operation.
    • It might be easier for you to add two lists together.

How should Y be constructed? The instruction claimed that Y should be one time step ahead. How can I implement it? How could I get the X that is one step ahead and assign it for the implementation of Y? Thanks so much!

“Y” should not include the “None” character from X[0].
So Y should start from X[1:]

1 Like

Thanks so much, solved!