CSC 578 Neural Networks and Deep Learning

Slides:



Advertisements
Similar presentations
Visualization of hidden node activity in a feed forward neural network Adam Arvay.
Advertisements

 The most intelligent device - “Human Brain”.  The machine that revolutionized the whole world – “computer”.  Inefficiencies of the computer has lead.
CS 189 Brian Chu Slides at: brianchu.com/ml/
Multinomial Regression and the Softmax Activation Function Gary Cottrell.
Combining Models Foundations of Algorithms and Machine Learning (CS60020), IIT KGP, 2017: Indrajit Bhattacharya.
Neural networks and support vector machines
Big data classification using neural network
TensorFlow CS 5665 F16 practicum Karun Joseph, A Reference:
TensorFlow– A system for large-scale machine learning
Deep Learning Software: TensorFlow
CS 388: Natural Language Processing: LSTM Recurrent Neural Networks
Tensorflow Tutorial Homin Yoon.
Machine Learning Developments in ROOT Sergei Gleyzer, Lorenzo Moneta
Lecture 3. Fully Connected NN & Hello World of Deep Learning
ECE 5424: Introduction to Machine Learning
Why it is Called Tensor Flow Parallelism in ANNs Project Ideas and Discussion Glenn Fung Presents Batch Renormalizating Paper.
DeepCount Mark Lenson.
Deep Learning in HEP Large number of applications:
COMP24111: Machine Learning and Optimisation
Applications of Deep Learning and how to get started with implementation of deep learning Presentation By : Manaswi Advisor : Dr.Chinmay.
Deep Learning Libraries
Intro to NLP and Deep Learning
Mini Presentations - part 2
with Daniel L. Silver, Ph.D. Christian Frey, BBA April 11-12, 2017
Overview of TensorFlow
First Steps With Deep Learning Course.
Policy Compression for MDPs
Understanding the Difficulty of Training Deep Feedforward Neural Networks Qiyue Wang Oct 27, 2017.
TensorFlow and Clipper (Lecture 24, cs262a)
Introduction to CuDNN (CUDA Deep Neural Nets)
Neural Networks and Backpropagation
CSC 578 Neural Networks and Deep Learning
A brief introduction to neural network
Deep Learning Convoluted Neural Networks Part 2 11/13/
Tensorflow in Deep Learning
CSC 578 Neural Networks and Deep Learning
CSC 578 Neural Networks and Deep Learning
Brain Inspired Algorithms Dr. David Fagan
Deep Learning Packages
Introduction to Tensorflow
An open-source software library for Machine Intelligence
Limitations of Traditional Deep Network Architectures
Deep Neural Network Toolkits: What’s Under the Hood?
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
Introduction to Deep Learning with Keras
Chap. 7 Regularization for Deep Learning (7.8~7.12 )
Smart Robots, Drones, IoT
network of simple neuron-like computing elements
MNIST Dataset Training with Tensorflow
CSC 578 Neural Networks and Deep Learning
CSC 578 Neural Networks and Deep Learning
APACHE MXNET By Beni Mulyana.
Deep Learning and Mixed Integer Optimization
Long Short Term Memory within Recurrent Neural Networks
Neural Networks Geoff Hulten.
Object Tracking: Comparison of
Neural Networks II Chen Gao Virginia Tech ECE-5424G / CS-5824
实习生汇报 ——北邮 张安迪.
Keras.
Neural Networks II Chen Gao Virginia Tech ECE-5424G / CS-5824
Deep Learning Libraries
Debasis Bhattacharya, JD, DBA University of Hawaii Maui College
CSC 578 Neural Networks and Deep Learning
CSC 578 Neural Networks and Deep Learning
CSC 578 Neural Networks and Deep Learning
LHC beam mode classification
An introduction to neural network and machine learning
Overall Introduction for the Lecture
Machine Learning for Cyber
Machine Learning for Cyber
Presentation transcript:

CSC 578 Neural Networks and Deep Learning 5. TensorFlow and Keras (Some examples adapted from Jeff Heaton, T81-558: Applications of Deep Neural Networks) Noriko Tomuro

Intro to TensorFlow and Keras TensorFlow intro Using Keras Feed-forward Network using TensorFlow/Keras TensorFlow for Classification: (1) MNIST (2) IRIS TensorFlow for Regression: MPG Hyperparameters (1) Activation (2) Loss function (3) Optimizer (4) Regularizer (5) Early stopping Examples Noriko Tomuro

Jeff Heaton, T81-558: Applications of Deep Neural Networks 1. TensorFlow Intro TensorFlow is an open source software library, originally developed by the Google Brain team, for machine learning in various kinds of tasks. TensorFlow Homepage TensorFlow Install TensorFlow API (Version 1.10 for Python) TensorFlow is a low-level mathematics API, similar to Numpy. However, unlike Numpy, TensorFlow is built for deep learning. Jeff Heaton, T81-558: Applications of Deep Neural Networks

Jeff Heaton, T81-558: Applications of Deep Neural Networks Other Deep Learning Tools TensorFlow is not the only game in town. These are some of the best supported alternatives. Most of these are written in C++. TensorFlow Google's deep learning API. MXNet Apache foundation's deep learning API. Can be used through Keras. Theano - Python, from the academics that created deep learning. Keras - Also by Google, higher level framework that allows the use of TensorFlow, MXNet and Theano interchangeably.  Torch - LUA based. It has been used for some of the most advanced deep learning projects in the world. PaddlePaddle - Baidu's deep learning API. Deeplearning4J - Java based. GPU support in Java! Computational Network Toolkit (CNTK) - Microsoft. Support for Windows/Linux, command line only. GPU support. H2O - Java based. Supports all major platforms. Limited support for computer vision. No GPU support. Jeff Heaton, T81-558: Applications of Deep Neural Networks

Jeff Heaton, T81-558: Applications of Deep Neural Networks 2 Basic TensorFlow An example of basic TensorFlow (w/o ML or neural network; code link) Jeff Heaton, T81-558: Applications of Deep Neural Networks

Jeff Heaton, T81-558: Applications of Deep Neural Networks 3 Using Keras Keras is a layer on top of TensorFlow that makes it much easier to create neural networks. It provides a higher level API for various machine learning routines. Unless you are performing research into entirely new structures of deep neural networks it is unlikely that you need to program TensorFlow directly. Keras is a separate install from TensorFlow. To install Keras, use pip install keras (after installing TensorFlow). Jeff Heaton, T81-558: Applications of Deep Neural Networks

4 Feed-forward Network using TensorFlow/Keras Keras Sequential model is used to create a feed-forward network, by stacking layers (successive ‘add’ operations). Shape of the input layer is specified in the first hidden layer (or the output layer if network had no hidden layer). Below is an example of 100 x 32 x 1 network.

5 TensorFlow for Classification: (1) MNIST Google’s TensorFlow tutorial. code link Input 2D image is flattened to 1D vector. Dropout (with the rate 0.2) is applied to the first hidden layer

5 TensorFlow for Classification: (2) Iris Simple example of how to perform the Iris classification using TensorFlow. code link Notice ‘softmax’ for the output layer’s activation function – IRIS has 3 output nodes, for the 3 types of iris (Iris-setosa, Iris-versicolor, and Iris-virginica). Jeff Heaton, T81-558: Applications of Deep Neural Networks

6 TensorFlow for Regression: MPG Example of regressing using the MPG dataset [code link]. Notice: The activation function at the output layer is none. The loss function is MSE. Jeff Heaton, T81-558: Applications of Deep Neural Networks

Jeff Heaton, T81-558: Applications of Deep Neural Networks

Jeff Heaton, T81-558: Applications of Deep Neural Networks Some visualization of classification and regression [code link]: Confusion matrix (for Classification) Lift chart (for Regression) Jeff Heaton, T81-558: Applications of Deep Neural Networks

7 Hyperparameters: (1) Activation Activation functions (for neurons) are applied on a per-layer basis. Available options in Keras: ‘softmax’ ‘elu’ – The exponential linear activation: x if x > 0 and alpha * (exp(x)-1) if x < 0. ‘selu’ -- The scaled exponential unit activation: scale * elu(x, alpha). ‘softplus’ -- The softplus activation: log(exp(x) + 1). ‘softsign’ -- The softplus activation: x / (abs(x) + 1). ‘relu’ -- The (leaky) rectified linear unit activation: x if x > 0, alpha * x if x < 0. If max_value is defined, the result is truncated to this value. ‘tanh’ -- Hyperbolic tangent activation function. ‘sigmoid’ – Sigmoid activation function. ‘hardsigmoid’ ‘linear’ https://keras.io/activations/

7 Hyperparameters: (2) Loss function An optimizer is one of the two arguments required for compiling a Keras model: Available options for cost/loss functions in Keras: mean_squared_error mean_absolute_error mean_absolute_percentate_error mean_squared_logarithmic_error squared_hinge hinge categorical_hinge logcosh categorical_crossentropy sparse_categorical_crossentropy binary_crossentropy kullback_leibler_divergence poisson cosine_proximity Jeff Heaton, T81-558: Applications of Deep Neural Networks

7 Hyperparameters: (3) Optimizer An optimizer is one of the two arguments required for compiling a Keras model: Several optimizers are available, including SGD and adam (default). See the documentation for the various option parameters of each function.

7 Hyperparameters: (4) Regularizer Regularizers allow to apply penalties on layer parameters or layer activity during optimization. The penalties are applied on a per-layer basis. There are 3 types of regularizers in Keras: kernel_regularizer: applied to the kernel weights matrix. bias_regularizer: applied to the bias vector. activity_regularizer: applied to the output of the layer (its "activation"). Jeff Heaton, T81-558: Applications of Deep Neural Networks

7 Hyperparameters: (5) Early Stopping Example of early stopping. There are some parameters: monitor – quantity to be monitored min_delta -- minimum change in the monitored quantity to qualify as an improvement patience -- number of epochs with no improvement after which training will be stopped. Jeff Heaton, T81-558: Applications of Deep Neural Networks

Jeff Heaton, T81-558: Applications of Deep Neural Networks Early stopping with the best weights. This requires saving weights during learning (by using a ‘checkpoint’) and loading the best set of weights when testing. Jeff Heaton, T81-558: Applications of Deep Neural Networks

https://keras.io/getting-started/sequential-model-guide/#examples 8 Examples https://keras.io/getting-started/sequential-model-guide/#examples

https://keras.io/getting-started/sequential-model-guide/#examples