Giter Club home page Giter Club logo

dl_tutorial's Introduction

Riva tutorial - Introduction to Deep learning and CNNs

This part of the tutorial will introduce a simple CNN to classify the cifar10 dataset. Therefore we build a CNN to solve a classification task with 10 classes using the RGB images as direct input features.

Getting Started

Clone this repository to your local machine with:

git clone [email protected]:nlang/DL_tutorial.git

Download the required data from this link:

https://drive.google.com/open?id=1KoR9ISddhHsecsZG0lmePNONYKOZns1E

Move the directories into the DL_tutorial/ directory. The directory tree should look like this:

  • DL_tutorial/
    • data/
    • model_weights/
    • pretrained_models_imageNet/

Prerequisites

The tutorial will use keras with a tensorflow backend. We are going to write and execute the code in a jupyter notebook.

Therefore, we need to install:

  • python2 or python3
  • jupyter
  • tensorflow
  • keras

Further we will need the python packages/modules:

  • numpy
  • matplotlib
  • random

Our import section looks like this:

import numpy as np
import matplotlib.pyplot as plt
import random

from keras.models import Sequential
from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, Dropout
from keras.optimizers import RMSprop
from keras.datasets import mnist
from keras.utils import np_utils
from keras import initializers
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from keras.utils.vis_utils import plot_model

Installing

For windows: Tensorflow only exists for python3

python with pip

  • MacOS: Installation with homebrew follow the instructions from this link
  • Windows: link
  • Ubuntu: link

Make sure that pip2 or pip3 is installed. To check open a terminal and type:

pip2 help
pip3 help

Use pip2 or pip3 instead of pip in the following installations.

jupyter

Install jupyter with pip link

Type the following in your terminal:

pip install --upgrade pip
pip install jupyter

tensorflow

Follow the official installation instructions:

official tensorflow installation site

keras

To install keras on your system without a virtualenv:

official keras installation site

sudo pip install keras

Verify your installation

open a terminal and go to the location of the file: installation_check.ipynb

Then open the jupyter notebook with:

jupyter notebook installation_check.ipynb

If this does not automatically open a browser showing the notebook, then open a browser (Firefox, Chrome) and type:

http://localhost:8889/notebooks/installation_check.ipynb

Then select the first cell containing the imports and click on the > Run Button. If your installation was successful, the output should be like this:

successfully imported
keras version:  2.1.6

Running the code

In your terminal, go to the git repository and open the notebook with this command:

jupyter notebook CNN_tutorial.ipynb

Follow the instructions in the notebook:

  • Run cell by cell individually
  • Complete the missing parts of the code
  • Answer the questions

In the end: you can export the notebook as an html file: File/Download as/HTML

Code inspirations

Authors

  • Nico Lang

dl_tutorial's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.