Questionnaire
tip: Experiments: For the questions here that ask you to explain what some function or class is, you should also complete your own code experiments.
- What is
glob
? - How do you open an image with the Python imaging library?
- What does
L.map
do? - What does
Self
do? - What is
L.val2idx
? - What methods do you need to implement to create your own
Dataset
? - Why do we call
convert
when we open an image from Imagenette? - What does
~
do? How is it useful for splitting training and validation sets? - Does
~
work with theL
orTensor
classes? What about NumPy arrays, Python lists, or pandas DataFrames? - What is
ProcessPoolExecutor
? - How does
L.range(self.ds)
work? - What is
__iter__
? - What is
first
? - What is
permute
? Why is it needed? - What is a recursive function? How does it help us define the
parameters
method? - Write a recursive function that returns the first 20 items of the Fibonacci sequence.
- What is
super
? - Why do subclasses of
Module
need to overrideforward
instead of defining__call__
? - In
ConvLayer
, why doesinit
depend onact
? - Why does
Sequential
need to callregister_modules
? - Write a hook that prints the shape of every layer’s activations.
- What is “LogSumExp”?
- Why is
log_softmax
useful? - What is
GetAttr
? How is it helpful for callbacks? - Reimplement one of the callbacks in this chapter without inheriting from
Callback
orGetAttr
. - What does
Learner.__call__
do? - What is
getattr
? (Note the case difference toGetAttr
!) - Why is there a
try
block infit
? - Why do we check for
model.training
inone_batch
? - What is
store_attr
? - What is the purpose of
TrackResults.before_epoch
? - What does
model.cuda
do? How does it work? - Why do we need to check
model.training
inLRFinder
andOneCycle
? - Use cosine annealing in
OneCycle
.
Further Research
- Write
resnet18
from scratch (refer to <> as needed), and train it with theLearner
in this chapter. - Implement a batchnorm layer from scratch and use it in your
resnet18
. - Write a Mixup callback for use in this chapter.
- Add momentum to SGD.
- Pick a few features that you’re interested in from fastai (or any other library) and implement them in this chapter.
- Pick a research paper that’s not yet implemented in fastai or PyTorch and implement it in this chapter.
- Port it over to fastai.
- Submit a pull request to fastai, or create your own extension module and release it.
- Hint: you may find it helpful to use
nbdev
to create and deploy your package.
In [ ]: