concept PyTorch in category AI

appears as: PyTorch
Interpretable AI

This is an excerpt from Manning's book Interpretable AI.

Let’s now train a DNN for the breast cancer detection problem. We will be using Pytorch to build and train the network. PyTorch is a library that facilitates building neural networks in Python. PyTorch is gaining popularity among researchers and machine learning practitioners in the industry due to its ease of use. There are other libraries such as TensorFlow and Keras that can be used to build neural networks as well, but we will be focusing on PyTorch in this book. Since the library is pythonic, it will be easier for data scientists and engineers who are already familiar with Python to use it. To learn more about PyTorch, please see Appendix A. 

A.1           What is PyTorch?

PyTorch is a free, open-source library used for scientific computing and deep learning applications such as computer vision and natural language processing. It is Python based and is developed by Facebook’s AI Research (FAIR) lab. PyTorch is widely used by the research community and industry practitioners. A recent study done by Horace He shows that majority of the techniques published in major machine learning conferences in 2019 were implemented in PyTorch. There are other libraries and frameworks like Tensorflow, Keras, CNTK and MXNet that can be used to build and train neural networks, but we will be using PyTorch in this book. The library is pythonic and it utilizes Python idioms well. It is therefore easier for researchers, data scientists and engineers who are already familiar with Python to use it. PyTorch also provides great APIs to implement cutting-edge neural network architectures.

You can install the latest stable version of PyTorch using conda or pip as follows.

# Installing PyTorch using Conda
$> conda install pytorch torchvision -c pytorch
 
# Installing PyTorch using pip
$> pip install pytorch torchvision

Note that along with PyTorch, the torchvision package is also installed. This package consists of popular datasets, implementations of cutting-edge neural network architectures and common transformations done on images for computer vision tasks. You can check if the installation has succeeded by importing the libraries in your Python environment.