Unable to pass C2_M3 exercise 6 despite using optimal parameters and passing all previous tests

I am trying to pass the final exercise but can’t seem to get the F1 score or Loss to the necessary required targets. I still passed the assignment since I got all the points for the other exercises but I can’t seem to understand why the val_loss or F1 scores won’t go down even after multiple epochs. The Loss metrics remain the same (i.e. Val Loss = 1.6101 and Val F1 = 0.1323) regardless of changes to the hyper parameters like lr or epochs. I have posted a screenshot of the output I get. Any help would be appreciated!

My first guess is that you have an incorrect variable name somewhere in your code.

Yes, there must be some bug in your training logic. The training is not changing the model. I haven’t gotten to that assignment in C2 yet, but are you sure that you pass all the unit tests in the notebook?

@anonymous7888

Thinks to check in your previous! exercise 5 if you the right way to unfreeze the layers aas instruction! mentions to use negative indexing to get the last N layer of transformer i.e. -(i+1)

if you have done the correct way then check in excercise 4, compute class weight, if you have used the right variable names to get the unique class labels and training! labels. Remember training labels aree assigned as train_labels_list and you use the same variable name to get the unique class labels using np.unique.

if the above two are correct, then send me screenshot of your codes by personal DM(click on my name and then message)

Hi @anonymous7888,

I took a look at your notebook (all your exercises seem to have been implemented correctly) and ran it as it is, and I can see that your val loss and val F1 are changing (see screenshot below).

Though they are changing, this will fail the test because by the end your Val loss is 0.82 (greater than 0.7), so maybe just run for 2-5 epochs.

Anyways, either you have corrected your mistake, which is why they are changing now, or, I noticed that you have an extra code cell added just before the test cell of Exercise 3:

x,y = create_dataloaders(train_dataset, val_dataset, batch_size, data_collator)
x.dataset['labels']

This addition is harmless in the notebook, but my other guess would be that before you might have added some code cell or tweaked the code somewhere which was overwriting something it shouldn’t be (similar to what Tom mentioned before), which is why you were getting those training results.

Since tests are self contained and independent, you would have passed them because they only look at your implemented exercises, and don’t rely on anything else from within the notebook.

Best,
Mubsi