All about Google Colab
What is Google Colaboratory?
Colaboratory allows users to execute Python code through a browser. This is favorable for Machine Learning and Data Science enthusiasts. The best part of Google Colab is that it provides free access to heavy computing resources such as GPUs & TPUs. Google Colab is a free to use tool.
What are the usage Limits of Google Colab?
Google Colab follows the concept of dynamic usage limit allocation. This fluctuates in response to the demand from users across the globe. The allocation of GPU and TPU resources are favored to users who use Colab interactively compared to the ones running long notebooks.
Notebooks can be run on Colab as long as 12 hours at a stretch, however the idle time behavior may vary over time based on dynamic resource allocation. The resource allocation in Google Colab is favored to the users who use less resources compared to the ones who hog them. So be wise and mindful using Colab :)
How to create your first Google Colab Notebook?
Step 1: Open your Google Drive and create a new folder:-
Step 2: Open the created folder -> Right Click -> Colaboratory
Step 3: Create a Notebook and change Theme
The Hardware Accelerator gives you options to choose between GPU/TPU
How to change Theme
Navigate to Settings -> Site -> dark
What are the different Hardware Accelerators in Google Colab?
Tensor Processing Unit (TPU)
Graphics Processing Unit (GPU)
When to use different Hardware Accelerators?
GPU should be used when dealing with large models. GPUs should be used when TPUs are not available. TPUs are used when performing complicated calculations on extremely large models which takes about weeks or even months to train.
Time & Validation Time on MNIST dataset[60000 Training images] (GPU vs TPU) comparison
GPU -> 82.6214 seconds
TPU -> 1465.9391 seconds
Although the Google Colab TPU is supposed to be much faster than GPUs, the TPU in our Notebook seems to be as slow as the CPU. Something seems terribly wrong. Comment if you have explanations for the same.
Sample Colab Notebooks
Feel free to subscribe for similar posts.