Issue with Dinosaur Island ex 4. Not learning properly

Hi, I have a problem with the exercise 4 of the Dinosaur Island assignment. I was able to generate words but they don’t make sense

Iteration: 22000, Loss: 40.261401

Olvtsrdneooeuerosariiisranskyieaidetcefaneaeodtqer
Loeaaersecanslseemuoecyceosbatsoeoeeootnheooneoeso
Lvtsrdneooeuerosariiisranskyieaidetcefaneaeodtqero
Oeaaersecanslseemuoecyceosbatsoeoeeootnheooneoeson
Ytsrdneooeuerosariiisranskyieaidetcefaneaeodtqeroo
Eaaersecanslseemuoecyceosbatsoeoeeootnheooneoesonl
Usrdneooeuerosariiisranskyieaidetcefaneaeodtqerood

I checked sintaxis and it seems to be ok. Can anyone help me? id lab=abbpiqfb

Even if the syntax is correct, that doesn’t mean your code works correctly.

I suspect problems with how you are indexing through the characters and turning them into code values.

The indexing is ok, because it resets after it runs all the examples. I wrote Y as X+ix_newline, I don’t know if it’s fine

You don’t want the entire X vector there, because X[0] is always [None].
Try X[1:] instead.

thanks! It is almost working, but it is not yet. I have a problem with exercise 2. It may have some influence? If you could help me with that wil be great. In ex 2 I see all the equations and replacement equations ok, but I don’t know why it is failing

{edited: and padded to minimum length}