Learning PyTorch
Just one of the things I'm learning. https://github.com/hchiam/learning
https://pytorch.org/get-started/locally --> this website automatically suggests how to install locally
e.g.:
conda install pytorch torchvision -c pytorch
or I think I prefer this:
pip3 install torch torchvision
or minimally just:
pip3 install torch
There's much more in the docs, but here's a sample of some interesting pages:
- recipes: https://pytorch.org/tutorials/recipes/recipes_index.html
- neural network: https://pytorch.org/tutorials/recipes/recipes/defining_a_neural_network.html
- saving/loading/using models: https://pytorch.org/tutorials/recipes/recipes/saving_and_loading_models_for_inference.html
- tutorials: https://pytorch.org/tutorials
- quickstart tutorial: https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html (python code to download open datasets, create models, set model params, save model, and load model for use)
- mobile deployment: https://pytorch.org/get-started/mobile
# creates model.pth:
python3 demo_run_save_model.py
# and now model.pth can be used by:
python3 demo_use_model.py
-
As a subprocess (I think this is easier): https://stackoverflow.com/a/11779234
-
Directly coding in C# as a library: https://github.com/dotnet/TorchSharp
- Here are some examples of using TorchSharp: https://github.com/dotnet/TorchSharpExamples/tree/main/src/CSharp/CSharpExamples
https://colab.research.google.com/drive/1roZqqhsdpCXZr8kgV_Bx_ABVBPgea3lX