Lesson 2 In-Class Discussion

do update
pip install -U kaggle-cli
somehow the version is old

@jeremy @yinterian thanks for a GREAT second lesson (amazing tips about learning rate annealing).

Quick question: is there any problem by not class-balancing the validation set by giving it randomly N% of the complete training data without caring about the labels?

Yes it would - the list is redundant here. Oops! Thanks for noticing.

Any time you want to actually print the result of zip, you have to turn it into a list (in Py3), so I guess it was habit!

You’re a fast learner!

5 Likes

I’ve added the lesson video to the top post. If you have any tips, links, etc, please edit the top post and add them!

Your validation set should be as close in distribution to your test set (and then to whatever you’ll face in production, if appropriate). So if the test set isn’t class balanced, the validation set shouldn’t be either.

We discuss this in more detail in the ML course, BTW.

3 Likes

Those weight files aren’t on Crestle yet. You can grab them from here: http://files.fast.ai/models/weights.tgz . Then untar them into the fastai folder in your repo.

@anurag , any chance you could put this somewhere in Crestle for everyone? They’re the weight files for the models, and they’re pretty big!

2 Likes

resnext50 is already available in fast.ai library!
Check the torch_imports.py file for a list of pre-trained models.

1 Like

Thanks @jeremy, good class!

Quick question, at some point you mentioned about modern archiectures, e.g. fully convolutional architectures. How they differ from older architectures, like VGG?

Why is these new architectures can handle different image sizes and VGG can’t?

Thanks!

The weights are already available on the AMI, but need to be downloaded otherwise.

If we fixed a seed for random generation we should be able to get the same results.

Every time you run a deep learning optimization there is randomness involve almost everywhere. For example, we use randomness in the cropping of images, in the initialization of weights etc… I think 0.993 is a very good result. You can run the

plot_confusion_matrix

and see how it differs from Jeremy’s.

1 Like

@jeremy something happened from last week to this week.
Before the learner was giving feedback when it was downloading the model from fast.ai.
Now it takes a lot of time to start the fit process??
Looks like the whole thing is taking all the memory on the system (16 GB)

Is that normal?

1 Like

Make sure you’ve git-pulled the repo.
That might correct any issues.

The weights are now available under /datasets/fast.ai/models/weights.

2 Likes

Thank you for your suggestion. I got some additional comments on this thread too.

– You can use cross-validation, one of the notebooks have an example on how to use it.
– You can add your own metrics. Look for the argument “metrics”.
– As Jeremy mentioned the best approach is to oversample the minority class. You can also under-sample the majority class.

2 Likes

@yinterian which notebook shows an example of how to use cross-validation? Jeremy had mentioned that it wasn’t needed unless the dataset was so small that we couldn’t afford to set aside the validation set. Is there a good benchmark/threshold for deciding when its “too small”? Or is it simply a matter of checking whether or not k-fold cv improves accuracy?

I think it was also mentioned that at the end of validation, you can actually run training one last time with the whole dataset (validation included) to get a better accuracy which again I guess would mean cv isn’t needed in that case.

Take a look at this notebook.

3 Likes

Hi I am getting this error from running:

from fastai.transforms import *

File “fastai/torch_imports.py”, line 26
if pre: load_model(m, f’{path}/weights/{fn}.pth’)
^
SyntaxError: invalid syntax

Is there something I am missing out here.

It is because VGG has fully connected layers which have a fixed number of weights – which depend on the required input size.
These links are helpful:


https://www.quora.com/How-is-Fully-Convolutional-Network-FCN-different-from-the-original-Convolutional-Neural-Network-CNN

3 Likes