Google Colaboratory

For most of the Machine Learning enthusiast one of the common road block is hardware capacity. Our daily use Laptop and Desktop are suitable for trivial example, but when trying real example they don't have enough horse power to run the code. Especially deep-learning models need high end GPUs and heavy RAM, Google Colaboratory provide Jupyter Notebook interface to high end hardware with GPU acceleration. As of now CoLab support Python 2.7 and Python 3.6, They are willing to introduce support for R and Scala but no ETA till now.

Google Colab have many interface to upload data to the virtual machine, One of the most convenient way to do it is store and retrieve data from Google Drive. Here a sample code snippet shows simple application which can be extended to complex requirement.

authenticateDrive function authenticate the Colab notebook with Google Drive, need to copy paste a authentication key manually in the Notebook interface. Its a one time activity. dowloadFile is a generic function, it downloads the file to colab environment given a Google drive file id. ConstructNet & TrainNetwork are application related functions.

Then comes the main function, Authenticate the drive, download the file, train the model, save the model locally and uploaded the model back to Google Drive for later use.