Assignment Trouble(2)

Hi everyone. Does anybody seen this syntax error?

After I typed this,

model.compile(optimizer=“Adam”, loss=“mse”, metrics=[“mae”])

I got this error.

File “”, line 27
model.compile(optimizer=“Adam”, loss=“mse”, metrics=[“mae”])
SyntaxError: invalid syntax

Thanks, Anthony

Please click my name and message your notebook as an attachment.

The notebook you sent doesn’t have the line in the original post:
model.compile(optimizer="Adam", loss="mse", metrics=["mae"])

What am I missing?

I forgot to use “#” to keep a record of the original.
However, I still have the syntax error. Can you please retype the code below so as not to have an error?

[code removed - moderator]

Something is off. The size seems not right. It started to get a different number from “train_padded_seqeunce” and “val_padded_sequence”. I do not know where it has gotten off. Can you please help look into it?

The attached file has the latest work that I did. Thanks.

[code removed - moderator]

Here are a few hints:

  1. There are bugs in train_val_split since you’re using constants instead of function parameters.
  2. seq_and_pad is buggy since you’re using global variables instead of function parameters.
  3. In tokenize_labels, follow this step as indicated in the markdown. Remember that when using numpy arrays you can simply do something like np.array - 1 to accomplish this since numpy allows for vectorized operations.
  4. This assignment is a classification problem. Selecting the right loss is important for the model training process.

Please follow instructions as in the course to improve your lab experience.

Thanks for the tip. I followed up 1, 2 but I don’t know what 3, 4 means.
I don’t know why I got this different outcome than expected.
Can you please help further? Thank you. Regards.

[code removed - moderator]

@Anthony_Lee Please don’t post your code on a public thread. Click my name and message the code as well as the trace via a direct message.