First, WTF is Google Colab?
Google Colab (https://colab.research.google.com/) is Google's collaborative version of the Jupyter/iPython notebook-based editing environment. They released the tool to the general public with a noble goal of dissemination of machine learning education and research.
You should be excited coz even Chris Olah is excited:
Wow, my favorite internal Google tool is now public! https://t.co/eq7Pu9VtHf (think iPython + Google Drive)— Chris Olah (@ch402) October 27, 2017
So much of my life is in colab.
Latest Feature: GPU
Its newest feature is the ability to use a GPU as a backend for free for 12 hours at a time. The details are as follows:
- The GPU used in the backend is a K80 (at this moment).
- The 12-hour limit is for a continuous assignment of virtual machine (VM).
What it means is that we can use the GPU even after the end of 12 hours by connecting to a different VM.
- You need to signup and apply for access before you can start using Google Colab.
- Once you have access, you can either upload your own notebook using
File → Upload Notebookor simply enter your codes in the cells.
- To enable GPU backend for your notebook, go to
Edit → Notebook Settingsand set
Enter these lines of codes into the cells:
!pip3 install http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl
!pip3 install torchvision
The output should look something like this:
And that's it!
Bonus: PyTorch Feedforward NN with GPU on Colab
Take a look at my Colab Notebook that uses PyTorch to train a feedforward neural network on the MNIST dataset with an accuracy of 98%.
Link to my Colab notebook: https://goo.gl/4U46tA
The focus here isn't on the DL/ML part, but the:
- Use of Google Colab.
- Use of Google Colab's GPU.
- Use of PyTorch in Google Colab with GPU.
Here's a preview of the aforementioned notebook:
If you enjoyed this post and want to buy me a cup of coffee...
The thing is, I'll always accept a cup of coffee. So feel free to buy me one.