Set of simple Pytorch scritps for better understanding pytorch fundamentals: tensors, loss functins, modules.
Some of examples are taken from https://pytorch.org/tutorials/
-
autograd.py - simple example showing how autograd mechanism works
-
cuda_device_info.py - how to check if cuda is available
-
tensors.py- how to create tensor
-
shapes.py - how to check tensor shape and reshapes to another dimension using 'view' function
-
loss_functions.py - how differnet loss function works (L1, mse, crossentrophy etc)
-
dorpout.py - how to apply dropout and why it scale output
-
nn_blocks.py - building blocks
-
lstm_input.py- how to prepare input for lstm, how to read output from lstm layer
-
loss_functions.py- how loss functions work and how theri output look like
-
loss_functions_combined.py- how to combine valued from more then one loss function,
-
softmax_accuracy.py- how compute softmax for multilabel multivalue output and how to compute accuracy based on softmax output