Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Tutorial for Google Colab added #234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions docs/tutorials/Google-Colaboratory-setup/Using_ELL_in_Colab.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Using_ELL_in_Colab.ipynb",
"provenance": [],
"collapsed_sections": [
"B-ZvwR1xCbIj",
"rGIpbb8I1ia_",
"EImJ8zAu0pft",
"qXCg279c9K4J",
"jjZQ9x2GFx2d",
"S4IdnctJdmzK",
"yG-KQm4cdzyn",
"rUY1J5Nkeevh",
"TR3mOcAKuKiC",
"wuZo3-yLfa3O",
"16Rs_5vzffox",
"saRJ1aCrwods",
"UoO1Z2PkgWlJ",
"O_xxjMLJjB3E",
"TcWZXKcwEXuV",
"oJoC8q-lmcQ1",
"RTxb1qFXm3NW",
"DTMcYT71zX2K"
]
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "d1VlrdClNx7M",
"colab_type": "text"
},
"source": [
"# Introduction\n",
"In this Jupyter Notebook, we are going to setup ELL.\n",
"\n",
"Note: You should prefer to use Python3 and Hardware Accelerator as GPU"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "B-ZvwR1xCbIj",
"colab_type": "text"
},
"source": [
"# Installing Base Modules\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "2rIlw78XCZG9",
"colab_type": "code",
"colab": {}
},
"source": [
"%cd /content\n",
"!pip install gdown\n",
"#### Install required dependencies to build ELL\n",
"!sudo add-apt-repository --assume-yes ppa:ubuntu-toolchain-r/test\n",
"!sudo apt-get -y update\n",
"!sudo apt-get install -y gcc-8 g++-8 cmake libedit-dev zlibc zlib1g zlib1g-dev make\n",
"!sudo apt-get install -y libopenblas-dev doxygen\n",
"!sudo sh -c 'echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main >> /etc/apt/sources.list'\n",
"!sudo sh -c 'echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main >> /etc/apt/sources.list'\n",
"!wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -\n",
"!sudo apt-get update\n",
"!sudo apt-get install llvm-8 -y\n",
"!sudo apt-get install -y curl\n",
"!curl -O --location http://prdownloads.sourceforge.net/swig/swig-4.0.0.tar.gz\n",
"!tar zxvf swig-4.0.0.tar.gz\n",
"%cd swig-4.0.0\n",
"!./configure --without-pcre && make -j && sudo make install\n",
"%cd ..\n",
"### Setting up softlink with required version of gcc\n",
"!rm /usr/bin/gcc\n",
"!rm /usr/bin/g++\n",
"!ln -s /usr/bin/gcc-8 /usr/bin/gcc\n",
"!ln -s /usr/bin/g++-8 /usr/bin/g++"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "rGIpbb8I1ia_",
"colab_type": "text"
},
"source": [
"# Section 1 (USING ELL)\n",
"Select any of the following two ways to go forward:\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "EImJ8zAu0pft",
"colab_type": "text"
},
"source": [
"## 1. Using precompiled latest version of ELL\n",
"Latest compiled version: [v3.0.2](https://github.com/microsoft/ELL/releases/tag/v3.0.2)\n",
"\n",
"Run the cell below to download and unzip the Latest compiled ELL version"
]
},
{
"cell_type": "code",
"metadata": {
"id": "BnyuS3L0CWW1",
"colab_type": "code",
"colab": {}
},
"source": [
"%cd /content\n",
"!gdown https://drive.google.com/uc?id=1uxHoNex9xnIVevfe8hBPvpZrWrq71q3r\n",
"!unzip -q ELL.zip\n",
"%env ELL_ROOT=/content/ELL\n",
"!chmod +x $ELL_ROOT/build/bin/compile"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "qXCg279c9K4J",
"colab_type": "text"
},
"source": [
"## 2. Compiling latest version of ELL\n",
"Url to git repo : [link](https://github.com/microsoft/ELL)\n",
"\n",
"Note: Clone the version or branch which you want to use. If you are using version less than Release v3.0.1 then please take care of the version of SWIG that you have installed in this [cell](https://colab.research.google.com/drive/1XTARgz_3Cnd2NBB4_YxL8PzafcJ6JOWj#scrollTo=X5G5N40-S242&line=5&uniqifier=1)"
]
},
{
"cell_type": "code",
"metadata": {
"id": "dCs_qvSCgNvf",
"colab_type": "code",
"colab": {}
},
"source": [
"%cd /content\n",
"#### Cloning ELL repository\n",
"!git clone https://github.com/Microsoft/ELL.git\n",
"\n",
"### Building ELL\n",
"%cd /content/ELL\n",
"!mkdir build\n",
"%cd build\n",
"!rm -rf *\n",
"!cmake ..\n",
"!make -j4\n",
"!make _ELL_python\n",
"%cd ../..\n",
"%env ELL_ROOT=/content/ELL\n",
"!chmod +x $ELL_ROOT/build/bin/compile"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "LrtRdTZlmRue"
},
"source": [
"# References\n",
"\n",
"## Libraries and Tools\n",
"2. ELL by Microsoft ([link](https://github.com/microsoft/ELL)). License: [MIT License](https://github.com/microsoft/ELL/blob/master/LICENSE.txt)\n",
"\n",
"Contributers to the script: [mr-yamraj](https://github.com/mr-yamraj)"
]
}
]
}
15 changes: 15 additions & 0 deletions docs/tutorials/Google-Colaboratory-setup/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: default
title: Google Colaboratory Setup
permalink: /tutorials/Google-Colaboratory-setup/
---

# Google Colaboratory Setup

*by Yash Gaurkar*

Most Embedded Learning Library (ELL) tutorials follow a common workflow. You typically start by designing an ELL model on a laptop or desktop computer. It is easy to setup ELL on the system but it takes some time to build the binaries for ELL. And if you prefer to use Google Colab to train your model then you will prefer to generate the trained model on the same platform for different devices.

Find the colab notebook here:

* [ELL on Colab](https://colab.research.google.com/github//microsoft/ELL/blob/master/docs/tutorials/Google-Colaboratory-setup/Using_ELL_in_Colab.ipynb): This Notebook contains pre-build Latest Version of ELL and commands to build your preferred version of ELL. If you want to use pre-build Latest Version of ELL then you can get started within 5 mins of which most of the time it take to install Base Models for ELL.
1 change: 1 addition & 0 deletions docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permalink: /tutorials/

* [Raspberry Pi Setup](/ELL/tutorials/Raspberry-Pi-setup)
* [Active cooling your Raspberry Pi 3](/ELL/tutorials/Active-cooling-your-Raspberry-Pi-3)
* [Google Colaboratory Setup](/ELL/tutorials/Google-Colaboratory-setup)

## Image Classification Tutorials in Python

Expand Down