![Page 1: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/1.jpg)
1
Charles Killam, LP.D.
Modelling Time Series Data with Theano
Certified Instructor, NVIDIA Deep Learning InstituteNVIDIA Corporation
![Page 2: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/2.jpg)
2
DEEP LEARNING INSTITUTE
DLI Mission
Helping people solve challenging problems using AI and deep learning.
• Developers, data scientists and engineers
• Self-driving cars, healthcare and robotics
• Training, optimizing, and deploying deep neural networks
![Page 3: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/3.jpg)
33
TOPICS
• Lab Perspective
• RNNs / LSTMs
• Keras / Theano
• Pandas / Numpy / Matplotlib
• Lab
• Discussion / Overview
• Launching the Lab Environment
• Lab Review
![Page 4: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/4.jpg)
4
LAB PERSPECTIVE
![Page 5: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/5.jpg)
5
PURPOSE / GOAL
• Predict severity of illness in patients based on information found in electronic health records (EHRs)
• Provide feedback to clinicians when trying to assess the impact of treatment decision or raise early warning signs to flag
![Page 6: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/6.jpg)
6
WHAT THIS LAB IS
• Discussion on the tools, techniques and processes commonly used to build RNN / LSTM networks to evaluate EHRs
• Introduction to aspects of RNNs, LSTMs, Keras, Theano, Pandas, Numpy and Matplotlib
• Guided, hands-on exercise using the tools noted above to build a LSTM network to evaluate EHRs
![Page 7: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/7.jpg)
7
WHAT THIS LAB IS NOT
• Introduction to machine learning from first principles
• Explanation of electronic health records
• Rigorous mathematical formalism of neural networks
• Survey of all the features and options of Keras / Theano
![Page 8: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/8.jpg)
8
ASSUMPTIONS
• You are familiar with:
• Concept of electronic health records
• Basics of neural networks
• Basics of Pandas, Numpy and Matplotlib
• Helpful to have:
• Familiarity with recurrent neural network (RNNs)
![Page 9: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/9.jpg)
9
TAKE AWAYS
• Ability to setup your own recurrent neural network workflow using Keras / Theano and adapt it to your use case
• Know where to go for more info on RNNs, Keras and Theano
• Familiarity with data preparation process using Pandas, Numpy and Keras
![Page 10: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/10.jpg)
10
RNN / LSTM
![Page 11: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/11.jpg)
11
RECURRENT NEURAL NETWORK
• RNN = Recurrent Neural Network
• Similar to traditional feed-forward network
• RNNs include previous output state
• Limited to looking back only a few steps due to vanishing gradient
• Errors are backpropagated through time
• Inputs from previous time steps get exponentially down weighted and are eventually driven to zero
![Page 12: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/12.jpg)
12
RNN
![Page 13: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/13.jpg)
13
LONG SHORT TERM MEMORY
• LSTM = Long Short Term Memory
• Variant of RNN
• No vanishing gradient problem
• LSTMs can learn “very deep” tasks that require memories of events that happened or millions of discrete time steps ago
• At each time step a measurement is recorded and used as input into the LSTM to yield a probability of survival prediction
• Enables a real time monitoring of the patients probability of survival and insight into the patients trajectory
![Page 14: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/14.jpg)
14
KERAS RNN
![Page 15: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/15.jpg)
15
KERAS / THEANO
![Page 16: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/16.jpg)
16
KERAS
• Modular neural network written in Python
• Runs on TensorFlow and Theano
• Theano excels at RNNs / LSTMs
• Keras library allows for easy and fast prototyping
• Runs on GPUs and CPUs
• Compatible with Python 2.7 – 3.5
![Page 17: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/17.jpg)
17
THEANO
• Theano excels at RNNs in general and LSTMs in particular
• “Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently” (http://deeplearning.net/software/theano/)
• Runs on either GPU or CPU architectures
![Page 18: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/18.jpg)
18
PANDAS / NUMPY / MATPLOTLIB
![Page 19: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/19.jpg)
19
PANDAS
• Used in academia and commercial domains
• Open-source, BSD-licensed project
• Fast and efficient DataFrame object for data manipulation with integrated indexing
• Contains tools for reading and writing data between in-memory data structures and different formats such as:• CSV and text files• Microsoft Excel• SQL databases• HDF5
![Page 20: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/20.jpg)
20
NUMPY
• NumPy is a Python scientific computing package
• Open-source software
• Includes:
• Support for large, N-dimensional arrays and matrices
• Collection of high-level mathematical functions
![Page 21: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/21.jpg)
21
MATPLOTLIB
• Matplotlib is a Python 2D plotting library producing publication quality figures
• Matplotlib can be used in:
• Python scripts
• Python and IPython shell
• Jupyter notebook
• Web application servers
• Supports Python version 2.7 – 3.5
![Page 22: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/22.jpg)
22
LAB DISCUSSION / OVERVIEW
![Page 23: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/23.jpg)
23
DATA
• Electronic health records (EHRs)
• Contains medical treatments and histories of patients over time
• 15 years of data
• Data provided by PICU at Children’s Hospital Los Angeles
• 76,693 observations across 5,000+ unique patient encounters
• Data is an irregular time series of measurements taken over the course of a patient’s stay in the ICU
![Page 24: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/24.jpg)
24
DATA
Measurements include:
• Statistics - gender, age, weight
• Vitals - heart rate, respiratory rate
• Labs – glucose, creatinine
• Interventions – intubation, O2
• Drugs – dopamine, epinephrine
![Page 25: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/25.jpg)
25
DATA
• Not all measurements were taken for all patients
• Dependent variable:• Alive – 1• Not alive – 0
• 1,113,529 rows containing 265 independent variables
• Mean observations per patient encounter = 223
• Median observations per patient encounter = 94
![Page 26: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/26.jpg)
26
DATA• Hierarchical Data Format (HDF) 5
• Stores and organizes large amounts of scientific data
• Designed by National Center for Supercomputing Applications
• API supports most languages
• Libraries compatible with Windows, OSX and Linux
• Binary format
• Not human readable
• Efficient in storage size
• Scales will to very large operational projects
![Page 27: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/27.jpg)
27
LAB PROCESS
1. Setup
a. Configure Theano options
b. Import Numpy, Pandas and Matplotlib
c. Define folders which contain training / testing datasets
d. Load data using Pandas API
![Page 28: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/28.jpg)
28
LAB PROCESS
2. Data Preparation
a. Data review
b. Data normalization
c. Filling data gaps
d. Data sequencing
![Page 29: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/29.jpg)
29
LAB PROCESS
3. Architect LSTM network using Keras and Theano
4. Build the model (feed data into network for training)
5. Evaluate model using validation (test) data
6. Visualize results
7. Compare baseline to PRISM3 and PIM2
![Page 30: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/30.jpg)
30
LAB ENVIRONMENT
![Page 31: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/31.jpg)
31
NAVIGATING TO QWIKLABS
1. Navigate to: https://nvlabs.qwiklab.com
2. Login or create a new account
![Page 32: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/32.jpg)
32
ACCESSING LAB ENVIRONMENT
Click on Modelling Complex Data Sequences with Theano
Then click on Select
![Page 33: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/33.jpg)
33
ACCESSING LAB INSTRUCTIONS
1. Click “Start Lab” to create an instance of the lab environment
2. Once the lab environment starts, click “here” to access lab instructions (Jupyter notebook)
![Page 34: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/34.jpg)
34
ACCESSING LAB INSTRUCTIONSShould see Jupyter notebook
Place cursor in code block and click execute button
![Page 35: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/35.jpg)
35
ACCESSING LAB INSTRUCTIONS
Place cursor in code block and click execute button
![Page 36: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/36.jpg)
36
LAB REVIEW
![Page 37: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/37.jpg)
37
LAB REVIEW
1. Setup
a. Configure Theano options
b. Import Numpy, Pandas and Matplotlib
c. Define folders which contain training / testing datasets
d. Load data using Pandas API
![Page 38: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/38.jpg)
38
LAB REVIEW - IMPORT LIBRARIES #1B
![Page 39: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/39.jpg)
39
LAB REVIEW - DEFINE PATHS #1C
![Page 40: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/40.jpg)
40
LAB REVIEW - LOAD DATA #1D
![Page 41: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/41.jpg)
41
LAB REVIEW
2. Data Preparation
a. Data review
b. Data normalization
c. Filling data gaps
d. Data sequencing
![Page 42: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/42.jpg)
42
LAB REVIEW – DATA REVIEW #2A
![Page 43: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/43.jpg)
43
LAB REVIEW – DATA REVIEW #2A
![Page 44: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/44.jpg)
44
LAB REVIEW – DATA REVIEW #2A
![Page 45: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/45.jpg)
45
LAB REVIEW – DATA REVIEW #2A
![Page 46: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/46.jpg)
46
LAB REVIEW – DATA REVIEW #2A
![Page 47: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/47.jpg)
47
LAB REVIEW - DATA NORMALIZATION #2B
![Page 48: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/48.jpg)
48
LAB REVIEW - DATA GAPS #2C
![Page 49: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/49.jpg)
49
LAB REVIEW - DATA GAPS #2C
![Page 50: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/50.jpg)
50
LAB REVIEW - DATA GAPS #2C
![Page 51: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/51.jpg)
51
LAB REVIEW - DATA GAPS #2C
![Page 52: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/52.jpg)
52
LAB REVIEW - DATA SEQUENCING #2D
![Page 53: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/53.jpg)
53
LAB REVIEW - DATA SEQUENCING #2D
![Page 54: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/54.jpg)
54
LAB REVIEW - DATA SEQUENCING #2D
![Page 55: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/55.jpg)
55
LAB REVIEW
3. Architect LSTM network using Keras and Theano
4. Build the model (feed data into network for training)
5. Evaluate model using validation (test) data
6. Visualize results
7. Compare baseline to PRISM3 and PIM2
![Page 56: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/56.jpg)
56
LAB REVIEW - ARCHITECT LSTM #3
![Page 57: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/57.jpg)
57
LAB REVIEW - ARCHITECT LSTM #3
![Page 58: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/58.jpg)
58
LAB REVIEW – BUILD / TRAIN MODEL #4
![Page 59: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/59.jpg)
59
LAB REVIEW – EVALUATE MODEL #5
That is, we have 2690 patient
encounters for testing, and at
each of the observations the
model predicts survivability. Lets
plot some predictions!
![Page 60: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/60.jpg)
60
LAB REVIEW - VISUALIZE RESULTS #6
![Page 61: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/61.jpg)
61
LAB REVIEW - COMPARE BASELINE #7
![Page 62: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/62.jpg)
62
LAB REVIEW - COMPARE BASELINE #7
![Page 63: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/63.jpg)
63
LAB REVIEW - COMPARE BASELINE #7
![Page 64: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/64.jpg)
64
WHAT ELSE?
• Many ways to explore and improve model:
• Add a second and third LSTM layer to the network
• Change the number of layers and the number of neurons in those layers
• Change some of the meta parameters in the network configuration like dropout or learning rate, etc.
• Try using a CNN? Does it outperform the RNN / LSTM model?
![Page 65: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/65.jpg)
65
WHAT’S NEXT
![Page 66: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/66.jpg)
66
WHAT’S NEXT
• Use / practice what you learned
• Discuss with peers practical applications of DNN
• Reach out to NVIDIA and the Deep Learning Institute
• Attend local meetup groups
• Follow people like Andrej Karpathy and Andrew Ng
![Page 67: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/67.jpg)
6767
WHAT’S NEXT
…for the chance to win an NVIDIA SHIELD TV.
Check your email for a link.
TAKE SURVEYCheck your email for details to access more DLI training online.
ACCESS ONLINE LABS
Visit www.nvidia.com/dli for workshops in your area.
ATTEND WORKSHOPVisit https://developer.nvidia.com/join for more.
JOIN DEVELOPER PROGRAM
![Page 68: Modelling Time Series Data with Theano - NVIDIA€¦ · Modelling Time Series Data with Theano Certified Instructor, NVIDIA Deep Learning Institute ... • LSTMs can learn “very](https://reader034.vdocuments.site/reader034/viewer/2022051604/60037baffdf07b64a06e2390/html5/thumbnails/68.jpg)
68
www.nvidia.com/dli