I can't get past the W1 assignment

I understand why this statement, but for the future, the team should note

trax.layers.metrics. CrossEntropyLoss ()

Returns a layer that outputs multiclass prediction-target cross-entropy.

DEPRECATED; refactor to use WeightedCategoryCrossEntropy or CategoryCrossEntropy instead.

from the page trax.layers — Trax documentation as of 27 FEB 2022. Something for the work item list.

Hi @ai_curious,

Thank you for bringing this to my attention. Can you DM your notebook so that we can take a look and update things accordingly ?

Thanks,
Mubsi

My notebook is ok and won’t show you anything new. Was merely corroborating the previous poster who noticed that the loss function specified in the provided code is deprecated.

Here’s where it occurs, in section 4.1 of the notebook


# PLEASE, DO NOT MODIFY OR DELETE THIS CELL
from trax.supervised import training

def get_train_eval_tasks(train_pos, train_neg, val_pos, val_neg, vocab_dict, loop, batch_size = 16):
    
    rnd.seed(271)

    train_task = training.TrainTask(
        labeled_data=train_generator(batch_size, train_pos
                    , train_neg, vocab_dict, loop
                    , shuffle = True),
        loss_layer=tl.CrossEntropyLoss(),  #DEPRECATED
        optimizer=trax.optimizers.Adam(0.01),
        n_steps_per_checkpoint=10,
    )

Hi @Mubsi

I have a problem with my W4 assignment (Transformer one). I finished the assignment a few months ago, but when I want to check it again now, all my answers are gone, the only thing I could see is “None” at those to-do areas. Could you please help me to check if you could retrieve my old submission? My lab is jlbbpoty.

Thank you very much!

Hi @ywc,

There are two possibilities here:

First: The assignment got updated since you last opened it, and now your old assignment version is in the workplace, while the new version is what you are seeing.

  • When you open your lab, go to File —> Open…
  • When the panel opens, see if you can see your old assignment version, which will have date and time appended in its name. It will look something like, C3_W1_Assignment_date_time.ipynb

Note: if that’s the case, and you find your old assignment, it doesn’t necessarily means that those solutions will still hold true, as the unit tests might have been updated. You’d have to run it to find out.

If this is not the case, then…

Second: The NLP specialisation got updated back in October 2021. Maybe you last opened your assignment before that ?

If that’s case, your old assignment file is unretrievable, as when it got updated, the assignments and the auto graders were revised.

Let me know whatever happens,
Mubsi