Table of contents
training function, validation function
When we write a deep learning project, we need to understand the general process of deep learning
Basic task flow:
-
data flow
- File partitioning (training, validation file paths and corresponding labels)
- Override of Dataset class
- __len__ override
- __getitem__ override
- Encapsulation of Dateloader
- Dataset
- Batchsize
- Shuffle - whether to shuffle (in the validation set, no need to shuffle)
-
Model building
-
training function, validation function
- training function
- validation function
- Don't need gradient, you can use decorator @torch.no_grad()/with torch.on_grad()
- Get the accuracy and loss values
-
optimizer
- torch.optim
-
loss function
- Torch.nn. CrossEntropyLoss()
-
Weight saving and loading
-
Saving of run log files