20.03.2021 Views

Deep-Learning-with-PyTorch

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Exercises

355

12.8 Exercises

1 The F1 score can be generalized to support values other than 1.

a Read https://en.wikipedia.org/wiki/F1_score, and implement F2 and F0.5

scores.

b Determine which of F1, F2, and F0.5 makes the most sense for this project.

Track that value, and compare and contrast it with the F1 score. 6

2 Implement a WeightedRandomSampler approach to balancing the positive and

negative training samples for LunaDataset with ratio_int set to 0.

a How did you get the required information about the class of each sample?

b Which approach was easier? Which resulted in more readable code?

3 Experiment with different class-balancing schemes.

a What ratio results in the best score after two epochs? After 20?

b What if the ratio is a function of epoch_ndx?

4 Experiment with different data augmentation approaches.

a Can any of the existing approaches be made more aggressive (noise, offset,

and so on)?

b Does the inclusion of noise augmentation help or hinder your training

results?

– Are there other values that change this result?

c Research data augmentation that other projects have used. Are any applicable

here?

– Implement “mixup” augmentation for positive nodule candidates. Does it

help?

5 Change the initial normalization from nn.BatchNorm to something custom, and

retrain the model.

a Can you get better results using fixed normalization?

b What normalization offset and scale make sense?

c Do nonlinear normalizations like square roots help?

6 What other kinds of data can TensorBoard display besides those we’ve covered

here?

a Can you have it display information about the weights of your network?

b What about intermediate results from running your model on a particular

sample?

– Does having the backbone of the model wrapped in an instance of

nn.Sequential help or hinder this effort?

6

Yep, that’s a hint it’s not the F1 score!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!