Lesson 2 - Official Topic

Can you explain the bears.new() syntax?

1 Like

This is a part that I find confusing. I am used to use the names training, validation and test sets for things that all come from the same bucket of labeled images.

In fastai instead, the test dataset is unlabeled (that was at least in v1).

I am curious about why was this choice made?

1 Like

This creates a new DataLoader based on other parameters you pass into it (this is also how the test_dl works)

1 Like

Probably inherited from Kaggle, where the test set never comes with labels :slight_smile:

2 Likes

@rachel can @jeremy explain this RandomResizedCrop on the code plz

A post was merged into an existing topic: Lesson 2 - Non-beginner discussion

How is fastai’s DataBlock different from PyTorch’s DataLoader?

1 Like

We follow the Kaggle convention, where a test set is something you need to predict on. But as Jeremy said, you can have multiple validation sets in fastai if you have a labeled test set.

9 Likes

Is exporting for PyTorch / TensorFlow different than the default export?

Follow on after the reply: If we want to deploy a model outside of a premade webapp (e.g. to a Jetson Nano or a Google Coral), how would we export it for this case?

1 Like

Thank you for another great class!

2 Likes

Very interesting lesson! Thanks Jeremy and Rachel!

Is .predict() the most efficient way to do it? From what I understand in training you process batches of images at the time, there it seems you only process one at a time. I’m thinking about a queue to batch predictions requests

I’ll have a look at the paper. But if that were true, then sneeze and cough droplets would attenuate the virus rather than spread it.

IIRC the default export in FastAI gives you a pickle file whereas a PyTorch/TF model will give you respective weights in their own format

2 Likes

Not if you have many samples. Then get_preds would be ideal as you can run it over many batches of data

4 Likes

Thanks Jeremy and Rachel,
What needs to be installed on the deployment server to make sure our model works?
Do we need a GPU to run our models on the server?

No, you will not. CPU is sufficient.

2 Likes

Life is a Kaggle competition :slight_smile:

1 Like

Again, I am not well-versed in this topic, so I’ll defer to the experts. But in the paper I linked, there was this paragraph:

Finally, environmental conditions may impact transmission through effects on the vehicle itself, the respiratory droplet. The length of time a droplet remains airborne, and therefore available for inhalation, is dependent on its size: droplets of >20 μm in diameter settle out of the air rapidly, whereas those of <5 μm remain airborne for prolonged periods (16). Evaporation of water from respiratory droplets, which occurs more rapidly with declining RH, decreases droplet size and therefore increases the distance and time over which transmission can occur.

Relative humidity (RH) is very different from the moist droplets that are expelled during coughing or sneezing. The paper also notes that

influenza virus stability in an aerosol was shown to vary with RH

So, it’s at least conceivable to me that there are some pretty non-linear and unintuitive effects going on!

3 Likes

It randomly resizes the image and then crops it based on the size you pass it. There are nice visuals in the docs: https://dev.fast.ai/vision.augment#RandomResizedCrop