{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.4" }, "colab": { "name": "working_with_google_colab.ipynb", "provenance": [], "collapsed_sections": [] }, "accelerator": "GPU" }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "BJMkiXhDmQuc", "colab_type": "text" }, "source": [ "#
CS568:Deep Learning
Spring 2020
" ] }, { "cell_type": "markdown", "metadata": { "id": "LpXozP3XmT7l", "colab_type": "text" }, "source": [ "In this recitation, we will learn how to use google colab (google's free cloud service) for training deep learning models. We will learn the basic building blocks of Keras and how to use Keras library to train a neural network in google colab. \n" ] }, { "cell_type": "markdown", "metadata": { "id": "KYF5rlCJ0aHR", "colab_type": "text" }, "source": [ "The material in this notebook is adapted from [Kangrui Ruan](https://www.cs.cmu.edu/~bhiksha/courses/deeplearning/Fall.2019/www.f19/document/recitation/recitation1.tar.gz) and [official documentation](https://colab.research.google.com/notebooks/intro.ipynb). " ] }, { "cell_type": "markdown", "metadata": { "id": "8mQdZEuYmQvJ", "colab_type": "text" }, "source": [ "## Google Colab" ] }, { "cell_type": "markdown", "metadata": { "id": "eJpiVL2QmQvZ", "colab_type": "text" }, "source": [ "**_What is Google Colab?_**\n", "\n", "Google Colab is a Google research project created to help disseminate machine learning education and research. It's a Jupyter notebook environment that requires no setup to use and runs entirely in the cloud.\n", "\n", "Google Colab is ideal for working with deep learning libraries, like PyTorch, Keras, TensorFlow, and OpenCV. You can create notebooks in Colab, upload, store and share notebooks.\n", "\n", "With Colab you can import any dataset, train an image classifier on it, and evaluate the model, using just a few lines of code. Colab notebooks execute code on Google's cloud servers, by leveraging the power of Google hardware, including GPUs and TPUs, regardless of the power of your machine. \n" ] }, { "cell_type": "markdown", "metadata": { "id": "73y4GSQpmQvn", "colab_type": "text" }, "source": [ "**_What computing power does Google Colab provides?_**\n", "\n", "Google Colab connects our work space with a virtual machine having idle time of **90 minutes** and a maximum limit of **12 hours**. Each virtual machine comes with the following specifications:\n", "\n", "\n", "* GPU: 1xTesla K80 , having 2496 CUDA cores, compute 3.7, 12GB(11.439GB Usable) GDDR5 VRAM\n", "* CPU: 1xsingle core hyper threaded i.e(1 core, 2 threads) Xeon Processors @2.3Ghz (No Turbo Boost) , 45MB Cache\n", "* RAM: ~12.6 GB Available\n", "* Disk: ~320 GB Available \n", "\n", "For every 12hrs or so Disk, RAM, VRAM, CPU cache etc data that on google colab alloted virtual machine will get erased " ] }, { "cell_type": "markdown", "metadata": { "id": "Uo6yZkxdmQv2", "colab_type": "text" }, "source": [ "**_Working with Google Colab_**" ] }, { "cell_type": "markdown", "metadata": { "id": "fg2yWHNWmQwF", "colab_type": "text" }, "source": [ "+ Open your google drive.\n", "+ Create a new folder named \"DeepLearning\".\n", "+ Create your first google colab notebook via Right click > More > Google Colaboratory.\n", "+ To select the device you want to use (e.g CPU, GPU or TPU), Go to Edit > Notebook Setting or Runtime > Change runtime type and select GPU as hardware." ] }, { "cell_type": "markdown", "metadata": { "id": "YnVfygVGmQwS", "colab_type": "text" }, "source": [ "Now you can run your python basic codes here. " ] }, { "cell_type": "markdown", "metadata": { "id": "u22SsdUxmQwc", "colab_type": "text" }, "source": [ "**Useful Colab Notebooks and links**\n", "\n", "* [Getting Started with Google Colab](https://towardsdatascience.com/getting-started-with-google-colab-f2fff97f594c)\n", "* [Accessing External Data: Local Files, Google Drive](https://colab.research.google.com/notebooks/io.ipynb#scrollTo=5iRYBSVCbAlK)\n", "* [Syncing/Saving to Github](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)" ] } ] }