/pytorch-tensors

Introduction to tensors basic operations

Primary LanguageJupyter Notebook

pytorch-tensors

Introduction to Pytorch tensor basic operations.

Here there are some jupyter notebook (.ipynb) files that guides you through the basics of pytorch-tensors.

Anyone intrested can clone this repository and run in their local machine in the continous cycle of learning and exploring. I have written these codes with the reference of official pytorch documentation and some tutorials.

You can find the pytorch documentation at : https://pytorch.org/docs/stable/index.html

TABLE OF CONTENTS:

I will provide you the overview of each notebook files so you can choose the best for you.

1. getting_started.ipynb

-> This notebook file contains :

a.Chossing devives (CPU or GPU)
b.Working with tensors
c.Common initialization methods
d.Initializing and converting tensors into different types
e.Numpy array to tensor conversion and vice versa

2.math_operation.ipynb

-> This notebook files contains :

a.Tensor Math and Comparision Operation
-Addition
-Subtraction
-Division ( element wise division)
-Exponentiation
-Inplace operations
-Single Comparision
-Matrix Multiplication
-Matrix Exponentiation
-Element Wise matrix multiplication
-Dot Product
-Batch matrix multiplicaiton
b.Broadcasting Example

3.tensor_indexing.ipynb

-> This notebook file contains:

a.Tensor Indexing
b.Finding the features of first batch
c.Gettin features from every batches
d.Fancy Indexing
e.Advanced Indexing
f.Useful operation and finding dimension

4.tensor_reshaping.ipynb

-> This notebook file contains:

a.Reshaping tensors
b.Transpose

INSTALLATION:

To run these files you should install pytorch in your local environment. I suggest creating virtual environment using Anconda Navigator. Install anaconda navigator from https://docs.anaconda.com/anaconda/install/.

Create virutal enviroment by following the given article : https://medium.com/@chinmay.s077/how-to-create-environment-in-anaconda-982ffc9f3a07

After sucessfully creating the virtual environment run the following command to install pytorch :

For linux OS using CPU in conda package : conda install pytorch torchvision torchaudio cpuonly -c pytorch

If you have different systems then you can choose as per your requirement by visiting https://pytorch.org/.

Thank you. Asim Mahat ( April 14,2021)