Questionnaire

  1. Why do we say that fastai has a “layered” API? What does it mean?
  2. Why does a Transform have a decode method? What does it do?
  3. Why does a Transform have a setup method? What does it do?
  4. How does a Transform work when called on a tuple?
  5. Which methods do you need to implement when writing your own Transform?
  6. Write a Normalize transform that fully normalizes items (subtract the mean and divide by the standard deviation of the dataset), and that can decode that behavior. Try not to peek!
  7. Write a Transform that does the numericalization of tokenized texts (it should set its vocab automatically from the dataset seen and have a decode method). Look at the source code of fastai if you need help.
  8. What is a Pipeline?
  9. What is a TfmdLists?
  10. What is a Datasets? How is it different from a TfmdLists?
  11. Why are TfmdLists and Datasets named with an “s”?
  12. How can you build a DataLoaders from a TfmdLists or a Datasets?
  13. How do you pass item_tfms and batch_tfms when building a DataLoaders from a TfmdLists or a Datasets?
  14. What do you need to do when you want to have your custom items work with methods like show_batch or show_results?
  15. Why can we easily apply fastai data augmentation transforms to the SiamesePair we built?

Further Research

  1. Use the mid-level API to prepare the data in DataLoaders on your own datasets. Try this with the Pet dataset and the Adult dataset from Chapter 1.
  2. Look at the Siamese tutorial in the fastai documentation to learn how to customize the behavior of show_batch and show_results for new type of items. Implement it in your own project.