Facebook already uses its own Open Source AI,
For those who are not familiar, PyTorch is a Python-based library for Scientific Computing.
PyTorch harnesses the superior computational power of Graphical Processing Units (GPUs) for carrying out complex Tensor computations and implementing deep neural networks. So, it is used widely across the world by numerous researchers and developers.
Highlights of PyTorch 1.0 Release Candidate
Some of the main new features in the release candidate are:
JIT is a set of compiler tools to bring research close to production. It includes a Python-based language called Torch Script and also ways to make existing code compatible with itself.
2. New torch.distributed library: “C10D”
“C10D” enables asynchronous operation on different backends with performance improvements on slower networks and more.
3. C++ frontend (experimental)
Though it has been specifically mentioned as an unstable API (expected in a pre-release), this is a pure C++ interface to the PyTorch backend that follows the API and architecture of the established Python frontend to enable research in high performance, low latency and C++ applications installed directly on hardware.
To know more, you can take a look at the complete update notes on GitHub.
The first stable version PyTorch 1.0 will be released in summer.
Installing PyTorch on Linux
To install PyTorch v1.0rc0, the developers recommend using Conda while there also other ways to do that as shown on their local installation page where they have documented everything necessary in detail.
- CUDA (For Nvidia GPU owners)
As we recently showed you how to install and use Pip, let’s get to know how we can install PyTorch with it.
Note that PyTorch has GPU and CPU-only variants. You should install the one that suits your hardware.
Installing old and stable version of PyTorch
If you want the stable release (version 0.4) for your GPU, use:
pip install torch torchvision
Use these two commands in succession for a CPU-only stable release:
pip install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl pip install torchvision
Installing PyTorch 1.0 Release Candidate
You install PyTorch 1.0 RC GPU version with this command:
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html
If you do not have a GPU and would prefer a CPU-only version, use:
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
Verifying your PyTorch installation
Startup the python console on a terminal with the following simple command:
Now enter the following sample code line by line to verify your installation:
from __future__ import print_function import torch x = torch.rand(5, 3) print(x)
You should get an output like:
tensor([[0.3380, 0.3845, 0.3217], [0.8337, 0.9050, 0.2650], [0.2979, 0.7141, 0.9069], [0.1449, 0.1132, 0.1375], [0.4675, 0.3947, 0.1426]])
To check whether you can use PyTorch’s GPU capabilities, use the following sample code:
import torch torch.cuda.is_available()
The resulting output should be:
Lets now look into some research projects that extensively use PyTorch:
Ongoing Research Projects based on PyTorch
- Detectron: Facebook AI Research’s software system to intelligently detect and classify objects. It is based on Caffe2. Earlier this year, Caffe2 and PyTorch joined forces to create a Research + Production enabled PyTorch 1.0 we talk about.
- Unsupervised Sentiment Discovery: Such methods are extensively used with social media algorithms.
- vid2vid: Photorealistic video-to-video translation
- DeepRecommender (We covered how such systems work on our past Netflix AI article)
Nvidia, leading GPU manufacturer covered more on this with their own update on this recent development where you can also read about ongoing collaborative research endeavours.
How should we react to such PyTorch capabilities?
To think Facebook applies such amazingly innovative projects and more in its social media algorithms, should we appreciate all this or get alarmed? This is almost Skynet! This newly improved production-ready pre-release of PyTorch will certainly push things further ahead! Feel free to share your thoughts with us in the comments below!