SlideShare a Scribd company logo
1 of 39
Download to read offline
1D Convolutional Neural Networks for
Time Series Modeling
PyData LA 2018
Nathan Janos and Jeff Roach
Who are we?
● Nathan Janos
○ Chief Data Officer @ System1 (4.5 years)
○ 15 years in ad-tech optimization
● Jeff Roach
○ Data Scientist @ System1 (2+ years)
○ Background in epidemiology
Part 1: Motivation and Prototype
Nathan Janos
From 2D to 1D
???
Graphics attributed to Mathworks and Wikipedia Creative Commons
Motivation
● Deep learning and the new wave of neural networks are increasingly popular
● Focus is in the visual space for classification
● We are interested in time series forecasting
● Couldn’t find as much modern work in this area
○ Sequence classification in language, text, audio
○ LSTM (long short-term memory), GRU (gated recurrent unit), RNN (recurrent NN)
Graphic attributed to Wikipedia Creative Commons
Discrete Time Signal Processing
● What about combining DSP with NNs?
○ Used in domains such as speech processing, sonar, radar, biomedical engineering, seismology
● Why not treat our hourly data as samples like one of these signals?
● 2D convolution works well for image classification
● Can 1D convolution work for time series forecasting?
● Had the idea to apply classic discrete time convolution techniques to 1D data...
Convolution
● Inspired by the convolution used in visual NNs (cross correlation)
● But instead use the definition of convolution used in signal processing
● It’s the integral of the product of two functions after one is reversed and shifted
Graphics attributed to Wikipedia Creative Commons
Basic Architecture
pool
relu
pool
relu
output = y(t+1)
hidden layer
hidden layer
regression
input = y(t)
convolve(input,weights)
Parameterized
w w w w w w w w w w w w w w w w w w w w w
y(t)
filter layer 1
T is length of time series
t size of intermediate time series
W is size of window
F is number of filters
D is depth of filters
F = 6
pool pool pool pool pool pool
relu relu relu relu relu relu
w w w w w w w w w w w w w w w w w w w w wfilter layer 2
pool pool pool pool pool pool
relu relu relu relu relu relu
D = 2
W = 24
T = 1512
t = 24
t = 12
t = 6
regression layer
w w w w w w
w w w w w w
w w w w w w
w w w w w w
w w w w w w
w w w w w w
y(t+1)
Parameter Space Example
● One layer of filters has n*(n + 1)/2 = 6(6-1)/2 = 15 weights
● Two layers = 15 * 2 = 30 filter weight parameters
● Two layers deep and a window of 24 hours = each bottom filter output has
24/2/2 = 6 values
● 6 filters * 6 output values = 36 regression weight parameters
● 66 total parameters
● A network with 24 filters, 3 deep, running on week of hourly of data = 1404
Learning About Learning Rate
iterations over time
learning rate
This is a type of stochastic gradient descent with restarts (SGDR)
Data and Testing
● Revenue per click data on mobile devices in automotive category
● Hourly data from 4/1/2018 to 6/2/2018 (63 days, 9 weeks of data)
● Train on first 8 weeks of hourly data
● Test on last week of data
● Compared MASE (mean absolute scaled error) of model to MASE of “simple”
1-hour lagged data model
○ MASE < 1.0 means we are beating the simple model
Best Network Results
● Using networks with about 6 filters, 3 deep, window of 24 hours of data
● Training took ~20 minutes
● Training on 8 weeks of data
● Best MASE compared to simple 1-hour lag model was ~0.86
Prototype Conclusion
● Probably should use GPU framework to make it faster
● Lots of time spent on hyperparameter tuning
● Should consider other network architectures
● Build out in an established NN framework to leverage backpropagation
Part 2: Architecture Extension and
Production PyTorch Implementation
Jeff Roach
Goals
● Port to Python
○ PyTorch
○ Fastai
● Find architecture improvements
● Beat current best production model (TBATS)
○ Linear time series model that captures complex seasonal trends
○ Exponential Smoothing State Space Model With Box-Cox Transformation, ARMA Errors, Trend And Seasonal
Components
○ TBATS R package to fit model as described in De Livera, Hyndman & Snyder (2011)
Architecture
w w w
y(t)
T is length of time series
t size of intermediate time series
W is size of window
F is number of filters
F = 1
pool
relu
w w w
pool
relu
W = 24
T = 1512
w w w w y(t+1)
WaveNet
ww
filter layer 1
filter layer 2
t = 24 in
t = 12 out
t = 6 in
regression layer
t = 12 in
t = 6 out
Architecture
w w w w w w w w w w w w w w w w w w w w w
y(t)
T is length of time series
t size of intermediate time series
W is size of window
F is number of filters
F = 6
pool pool pool pool pool pool
relu relu relu relu relu relu
w w w w w w w w w w w w w w w w w w w w w
pool pool pool pool pool pool
relu relu relu relu relu relu
W = 24
T = 1512
w w w w w w
w w w w w w
w w w w w w
w w w w w w
w w w w w w
w w w w w w y(t+1)
WaveNet Expansion
filter layer 1
filter layer 2
t = 24 in
t = 12 out
t = 6 in
regression layer
t = 12 in
t = 6 out
Architecture
w w w
y(t)
T is length of time series
t size of intermediate time series
W is size of window
F is number of filters
F = 1
pool
relu
w w w
pool
relu
W = 24
T = 1512
w w w w y(t+1)www1x
filter layer 1
filter layer 2
t = 24 in
t = 12 out
t = 6 in
regression layer
t = 12 in
t = 6 out
WaveNet Expansion
Architecture
w w w
y(t)
T is length of time series
t size of intermediate time series
W is size of window
F is number of filters
F = 6
pool
relu
w w w
pool
relu
W = 24
T = 1512
w y(t+1)w24x w12x 6x
filter layer 1
filter layer 2
t = 24 in
t = 12 out
t = 6 in
regression layer
t = 12 in
t = 6 out
WaveNet Expansion
Architecture
w w w
y(t)
filter layer 1
T is length of time series
t size of intermediate time series
W is size of window
pool
relu
w w wfilter layer 2
pool
relu
W = 24
T = 1512
t = 24 in
t = 12 out
t = 6 in
regression layer w y(t+1)
Ensemble
t = 12 in
t = 6 out
108x
Dropout
BatchNorm
(continuous variables)
relu
dropout
Embedding
Linear
Fully Connected
2x layers
1000, 500 neurons
0.001, 0.01 dropout
0.04 dropout
w500x
WaveNet
fastai’s MixedInputModel
Hour as category
FilterNet in PyTorch
class FilterNet(nn.Module):
def __init__(self, emb_szs, n_cont, emb_drop, out_sz, ...):
# Wavenet model layers
self.c1a = conv_layer(window=window // 2, ks=1, dilation=1)
self.c1b = conv_layer(window=window // 4, ks=1, dilation=2)
self.c2a = conv_layer(window=window // 2, ks=2, dilation=1)
self.c2b = conv_layer(window=window // 4, ks=2, dilation=2)
…
# Mixed Input model
...
# Final layer
self.f = Flatten()
self.lin = nn.Linear(szs[-1] + 108, out_sz, bias=False)
def forward(self, x_win, x_cat, x_cont):
# Wavenet model
self.f1a = self.c1a(x_win)
self.f1b = self.c1b(self.f1a)
self.f2a = self.c2a(x_win)
self.f2b = self.c2b(self.f2a)
…
x_wave = torch.cat([self.f1a, self.f1b, self.f2a, ... ], 2)
# Mixed Input Model
...
x_mix = dropout(x)
# Combine results from both nets
...
x_comb = torch.cat([x_wave, x_mix], 2)
lin_out = self.lin(self.f(x_comb))
return lin_out
Model Comparison t-1
Model (Language, Processing Unit) MASE Time
TBATS (R, CPU) 0.90 30s
WaveNet Expansion (Matlab, CPU) 0.86 1200s
WaveNet Expansion (PyTorch, GPU) 0.86 16s
FilterNet (PyTorch, GPU) 0.82 27s
Model Comparison t-1 Different Category
● Previously trained Automotive category
● Forecasted on Finance category
Trained on Automotive data Automotive Finance
TBATS (R, CPU) 0.90 0.96
FilterNet (PyTorch, GPU) 0.82 0.90
Model Comparison t-1 Missing Data
Replaced every nth step with n-1 past data point TBATS FilterNet % diff
2 step (every other) 1.23 1.29 +5%
6 1.03 0.98 -5%
12 0.98 0.91 -7%
24 0.96 0.87 -9%
MASE
Jagged Dataset
● Jagged
○ Categories use different features
○ Long/short time periods
○ Few/many missing data points
● ~1300 advertising categories
● Hourly data
● Training = 37 days or 888 hours
● Test = 7 days or 168 hours
Model Comparison t-1 Jagged
MASE Time
TBATS, Single Category 0.84 17s
FilterNet, Single Category 0.83 4s
FilterNet, Full training set (~1300 Categories) 0.78 60s
FilterNet, Full training set, test Category removed from training set 0.78 60s
Model Comparison t-1 Jagged
# of training set days TBATS FilterNet % diff
14 1.30 0.82 -37%
21 1.05 0.86 -18%
28 0.82 0.83 0%
37 0.84 0.83 0%
MASE
Conclusion
● FilterNet perks
○ Performance (7%)
○ Training speed (10%-300%)
○ Context
○ Less sensitive to data quantity
■ But, more sensitive to data quality
● Convolution and context models are complimentary
Questions?
Thanks for attending!
Prototype Training Detail
● Initialize
○ Seed filter weights with random values from [-1, -0.5, 0, 0.5, 1]
○ Seed regression weights with random values in range -0.2 to 0.2
○ Set learning rate to 1.0
● Iterate 100s to 100,000s of times
○ Forward propagate current network and store MSE
○ Randomly select a subset of weights (usually 10%) to move a small amount one at a time
■ Filter weights are moved in random increments of 0.1 or 0.01
■ Regression weights are moved by another different small amount
■ Store resulting MSE from moving each weight independently
○ Update parameters
■ If MSE for a filter weight delta is lower update it by that random increment
■ If MSE for a regression weight delta is lower update by gradient
○ Update learning rate: multiply by 0.95
○ If learning rate < threshold set back up to last initial learning rate * 0.95
References
● Time Series Wavenet paper
○ https://arxiv.org/pdf/1703.04691.pdf
Model Comparison t-1 Facebook
MASE Time
TBATS, Single Category 0.84 17s
FilterNet, Single Category, w/ imputed, Batch Size = 1 1.41 150s
FilterNet, Single Category, Batch Size = 1 0.84 150s
FilterNet, Single Category, Batch Size = 512 0.83 4s
FilterNet, Full training set (~1300 Categories) 0.78 60s
FilterNet, Full training set, w/o CNN 0.79 60s
FilterNet, Full training set, w/o Mixed Input 0.80 60s
FilterNet, Full training set, test Category removed from training set 0.78 60s
Production
● Inspired by how fastai loads pretrained models
● Save trained model to dictionary
○ State, structure, tuning parameters, etc.
● Model framework in common location
● Rebuild model using framework and dictionary

More Related Content

What's hot

Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural networkDEEPASHRI HK
 
Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural NetworkVignesh Suresh
 
Time series predictions using LSTMs
Time series predictions using LSTMsTime series predictions using LSTMs
Time series predictions using LSTMsSetu Chokshi
 
CNN Machine learning DeepLearning
CNN Machine learning DeepLearningCNN Machine learning DeepLearning
CNN Machine learning DeepLearningAbhishek Sharma
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networksmilad abbasi
 
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...Simplilearn
 
Convolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep LearningConvolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep LearningMohamed Loey
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learningAmr Rashed
 
Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)Olusola Amusan
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural NetworksAshray Bhandare
 
Convolutional neural network
Convolutional neural network Convolutional neural network
Convolutional neural network Yan Xu
 
Convolutional Neural Network (CNN) - image recognition
Convolutional Neural Network (CNN)  - image recognitionConvolutional Neural Network (CNN)  - image recognition
Convolutional Neural Network (CNN) - image recognitionYUNG-KUEI CHEN
 
Optimization for Deep Learning
Optimization for Deep LearningOptimization for Deep Learning
Optimization for Deep LearningSebastian Ruder
 
Deep Learning in Computer Vision
Deep Learning in Computer VisionDeep Learning in Computer Vision
Deep Learning in Computer VisionSungjoon Choi
 
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...Simplilearn
 
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...Simplilearn
 

What's hot (20)

Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural Network
 
Time series predictions using LSTMs
Time series predictions using LSTMsTime series predictions using LSTMs
Time series predictions using LSTMs
 
CNN Machine learning DeepLearning
CNN Machine learning DeepLearningCNN Machine learning DeepLearning
CNN Machine learning DeepLearning
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
 
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
 
AlexNet
AlexNetAlexNet
AlexNet
 
Convolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep LearningConvolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep Learning
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
CNN Tutorial
CNN TutorialCNN Tutorial
CNN Tutorial
 
Deep learning presentation
Deep learning presentationDeep learning presentation
Deep learning presentation
 
Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)
 
HOPFIELD NETWORK
HOPFIELD NETWORKHOPFIELD NETWORK
HOPFIELD NETWORK
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
 
Convolutional neural network
Convolutional neural network Convolutional neural network
Convolutional neural network
 
Convolutional Neural Network (CNN) - image recognition
Convolutional Neural Network (CNN)  - image recognitionConvolutional Neural Network (CNN)  - image recognition
Convolutional Neural Network (CNN) - image recognition
 
Optimization for Deep Learning
Optimization for Deep LearningOptimization for Deep Learning
Optimization for Deep Learning
 
Deep Learning in Computer Vision
Deep Learning in Computer VisionDeep Learning in Computer Vision
Deep Learning in Computer Vision
 
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
 
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...
 

Similar to 1D Convolutional Neural Networks for Time Series Modeling - Nathan Janos, Jeff Roach

Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...
Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...
Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...Universitat Politècnica de Catalunya
 
Hardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningHardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningCastLabKAIST
 
Queuing theory and traffic analysis in depth
Queuing theory and traffic analysis in depthQueuing theory and traffic analysis in depth
Queuing theory and traffic analysis in depthIdcIdk1
 
Compressed learning for time series classification
Compressed learning for time series classificationCompressed learning for time series classification
Compressed learning for time series classification學翰 施
 
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020Universitat Politècnica de Catalunya
 
Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)Abdullah al Mamun
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learningJunaid Bhat
 
Course-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdfCourse-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdfShreeDevi42
 
Advanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdfAdvanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdfHariPrasad314745
 
SOLUTIONS MANUAL.pdf
SOLUTIONS MANUAL.pdfSOLUTIONS MANUAL.pdf
SOLUTIONS MANUAL.pdfSaharAhmed76
 
Introduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep LearningIntroduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep LearningVahid Mirjalili
 
Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...
Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...
Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...MLconf
 
Deep Turnover Forecast - meetup Lille
Deep Turnover Forecast - meetup LilleDeep Turnover Forecast - meetup Lille
Deep Turnover Forecast - meetup LilleCarta Alfonso
 
5.1 mining data streams
5.1 mining data streams5.1 mining data streams
5.1 mining data streamsKrish_ver2
 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfTulasiramKandula1
 
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...Universitat Politècnica de Catalunya
 
Online machine learning in Streaming Applications
Online machine learning in Streaming ApplicationsOnline machine learning in Streaming Applications
Online machine learning in Streaming ApplicationsStavros Kontopoulos
 

Similar to 1D Convolutional Neural Networks for Time Series Modeling - Nathan Janos, Jeff Roach (20)

Modeling full scale-data(2)
Modeling full scale-data(2)Modeling full scale-data(2)
Modeling full scale-data(2)
 
Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...
Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...
Multilayer Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intell...
 
Hardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningHardware Acceleration for Machine Learning
Hardware Acceleration for Machine Learning
 
IARE_DSP_PPT.pptx
IARE_DSP_PPT.pptxIARE_DSP_PPT.pptx
IARE_DSP_PPT.pptx
 
Queuing theory and traffic analysis in depth
Queuing theory and traffic analysis in depthQueuing theory and traffic analysis in depth
Queuing theory and traffic analysis in depth
 
Compressed learning for time series classification
Compressed learning for time series classificationCompressed learning for time series classification
Compressed learning for time series classification
 
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
 
Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Course-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdfCourse-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdf
 
Advanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdfAdvanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdf
 
SOLUTIONS MANUAL.pdf
SOLUTIONS MANUAL.pdfSOLUTIONS MANUAL.pdf
SOLUTIONS MANUAL.pdf
 
Introduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep LearningIntroduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep Learning
 
Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...
Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...
Hanjun Dai, PhD Student, School of Computational Science and Engineering, Geo...
 
Deep Turnover Forecast - meetup Lille
Deep Turnover Forecast - meetup LilleDeep Turnover Forecast - meetup Lille
Deep Turnover Forecast - meetup Lille
 
5.1 mining data streams
5.1 mining data streams5.1 mining data streams
5.1 mining data streams
 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdf
 
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
 
Tdm fdm
Tdm fdmTdm fdm
Tdm fdm
 
Online machine learning in Streaming Applications
Online machine learning in Streaming ApplicationsOnline machine learning in Streaming Applications
Online machine learning in Streaming Applications
 

More from PyData

Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...
Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...
Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...PyData
 
Unit testing data with marbles - Jane Stewart Adams, Leif Walsh
Unit testing data with marbles - Jane Stewart Adams, Leif WalshUnit testing data with marbles - Jane Stewart Adams, Leif Walsh
Unit testing data with marbles - Jane Stewart Adams, Leif WalshPyData
 
The TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake Bolewski
The TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake BolewskiThe TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake Bolewski
The TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake BolewskiPyData
 
Using Embeddings to Understand the Variance and Evolution of Data Science... ...
Using Embeddings to Understand the Variance and Evolution of Data Science... ...Using Embeddings to Understand the Variance and Evolution of Data Science... ...
Using Embeddings to Understand the Variance and Evolution of Data Science... ...PyData
 
Deploying Data Science for Distribution of The New York Times - Anne Bauer
Deploying Data Science for Distribution of The New York Times - Anne BauerDeploying Data Science for Distribution of The New York Times - Anne Bauer
Deploying Data Science for Distribution of The New York Times - Anne BauerPyData
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaPyData
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...PyData
 
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroRESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroPyData
 
Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...
Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...
Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...PyData
 
Avoiding Bad Database Surprises: Simulation and Scalability - Steven Lott
Avoiding Bad Database Surprises: Simulation and Scalability - Steven LottAvoiding Bad Database Surprises: Simulation and Scalability - Steven Lott
Avoiding Bad Database Surprises: Simulation and Scalability - Steven LottPyData
 
Words in Space - Rebecca Bilbro
Words in Space - Rebecca BilbroWords in Space - Rebecca Bilbro
Words in Space - Rebecca BilbroPyData
 
End-to-End Machine learning pipelines for Python driven organizations - Nick ...
End-to-End Machine learning pipelines for Python driven organizations - Nick ...End-to-End Machine learning pipelines for Python driven organizations - Nick ...
End-to-End Machine learning pipelines for Python driven organizations - Nick ...PyData
 
Pydata beautiful soup - Monica Puerto
Pydata beautiful soup - Monica PuertoPydata beautiful soup - Monica Puerto
Pydata beautiful soup - Monica PuertoPyData
 
Extending Pandas with Custom Types - Will Ayd
Extending Pandas with Custom Types - Will AydExtending Pandas with Custom Types - Will Ayd
Extending Pandas with Custom Types - Will AydPyData
 
Measuring Model Fairness - Stephen Hoover
Measuring Model Fairness - Stephen HooverMeasuring Model Fairness - Stephen Hoover
Measuring Model Fairness - Stephen HooverPyData
 
What's the Science in Data Science? - Skipper Seabold
What's the Science in Data Science? - Skipper SeaboldWhat's the Science in Data Science? - Skipper Seabold
What's the Science in Data Science? - Skipper SeaboldPyData
 
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...PyData
 
Solving very simple substitution ciphers algorithmically - Stephen Enright-Ward
Solving very simple substitution ciphers algorithmically - Stephen Enright-WardSolving very simple substitution ciphers algorithmically - Stephen Enright-Ward
Solving very simple substitution ciphers algorithmically - Stephen Enright-WardPyData
 
The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...
The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...
The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...PyData
 
Deprecating the state machine: building conversational AI with the Rasa stack...
Deprecating the state machine: building conversational AI with the Rasa stack...Deprecating the state machine: building conversational AI with the Rasa stack...
Deprecating the state machine: building conversational AI with the Rasa stack...PyData
 

More from PyData (20)

Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...
Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...
Michal Mucha: Build and Deploy an End-to-end Streaming NLP Insight System | P...
 
Unit testing data with marbles - Jane Stewart Adams, Leif Walsh
Unit testing data with marbles - Jane Stewart Adams, Leif WalshUnit testing data with marbles - Jane Stewart Adams, Leif Walsh
Unit testing data with marbles - Jane Stewart Adams, Leif Walsh
 
The TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake Bolewski
The TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake BolewskiThe TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake Bolewski
The TileDB Array Data Storage Manager - Stavros Papadopoulos, Jake Bolewski
 
Using Embeddings to Understand the Variance and Evolution of Data Science... ...
Using Embeddings to Understand the Variance and Evolution of Data Science... ...Using Embeddings to Understand the Variance and Evolution of Data Science... ...
Using Embeddings to Understand the Variance and Evolution of Data Science... ...
 
Deploying Data Science for Distribution of The New York Times - Anne Bauer
Deploying Data Science for Distribution of The New York Times - Anne BauerDeploying Data Science for Distribution of The New York Times - Anne Bauer
Deploying Data Science for Distribution of The New York Times - Anne Bauer
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
 
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo MazzaferroRESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
RESTful Machine Learning with Flask and TensorFlow Serving - Carlo Mazzaferro
 
Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...
Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...
Mining dockless bikeshare and dockless scootershare trip data - Stefanie Brod...
 
Avoiding Bad Database Surprises: Simulation and Scalability - Steven Lott
Avoiding Bad Database Surprises: Simulation and Scalability - Steven LottAvoiding Bad Database Surprises: Simulation and Scalability - Steven Lott
Avoiding Bad Database Surprises: Simulation and Scalability - Steven Lott
 
Words in Space - Rebecca Bilbro
Words in Space - Rebecca BilbroWords in Space - Rebecca Bilbro
Words in Space - Rebecca Bilbro
 
End-to-End Machine learning pipelines for Python driven organizations - Nick ...
End-to-End Machine learning pipelines for Python driven organizations - Nick ...End-to-End Machine learning pipelines for Python driven organizations - Nick ...
End-to-End Machine learning pipelines for Python driven organizations - Nick ...
 
Pydata beautiful soup - Monica Puerto
Pydata beautiful soup - Monica PuertoPydata beautiful soup - Monica Puerto
Pydata beautiful soup - Monica Puerto
 
Extending Pandas with Custom Types - Will Ayd
Extending Pandas with Custom Types - Will AydExtending Pandas with Custom Types - Will Ayd
Extending Pandas with Custom Types - Will Ayd
 
Measuring Model Fairness - Stephen Hoover
Measuring Model Fairness - Stephen HooverMeasuring Model Fairness - Stephen Hoover
Measuring Model Fairness - Stephen Hoover
 
What's the Science in Data Science? - Skipper Seabold
What's the Science in Data Science? - Skipper SeaboldWhat's the Science in Data Science? - Skipper Seabold
What's the Science in Data Science? - Skipper Seabold
 
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
 
Solving very simple substitution ciphers algorithmically - Stephen Enright-Ward
Solving very simple substitution ciphers algorithmically - Stephen Enright-WardSolving very simple substitution ciphers algorithmically - Stephen Enright-Ward
Solving very simple substitution ciphers algorithmically - Stephen Enright-Ward
 
The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...
The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...
The Face of Nanomaterials: Insightful Classification Using Deep Learning - An...
 
Deprecating the state machine: building conversational AI with the Rasa stack...
Deprecating the state machine: building conversational AI with the Rasa stack...Deprecating the state machine: building conversational AI with the Rasa stack...
Deprecating the state machine: building conversational AI with the Rasa stack...
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

1D Convolutional Neural Networks for Time Series Modeling - Nathan Janos, Jeff Roach

  • 1. 1D Convolutional Neural Networks for Time Series Modeling PyData LA 2018 Nathan Janos and Jeff Roach
  • 2. Who are we? ● Nathan Janos ○ Chief Data Officer @ System1 (4.5 years) ○ 15 years in ad-tech optimization ● Jeff Roach ○ Data Scientist @ System1 (2+ years) ○ Background in epidemiology
  • 3. Part 1: Motivation and Prototype Nathan Janos
  • 4. From 2D to 1D ??? Graphics attributed to Mathworks and Wikipedia Creative Commons
  • 5. Motivation ● Deep learning and the new wave of neural networks are increasingly popular ● Focus is in the visual space for classification ● We are interested in time series forecasting ● Couldn’t find as much modern work in this area ○ Sequence classification in language, text, audio ○ LSTM (long short-term memory), GRU (gated recurrent unit), RNN (recurrent NN) Graphic attributed to Wikipedia Creative Commons
  • 6. Discrete Time Signal Processing ● What about combining DSP with NNs? ○ Used in domains such as speech processing, sonar, radar, biomedical engineering, seismology ● Why not treat our hourly data as samples like one of these signals? ● 2D convolution works well for image classification ● Can 1D convolution work for time series forecasting? ● Had the idea to apply classic discrete time convolution techniques to 1D data...
  • 7. Convolution ● Inspired by the convolution used in visual NNs (cross correlation) ● But instead use the definition of convolution used in signal processing ● It’s the integral of the product of two functions after one is reversed and shifted Graphics attributed to Wikipedia Creative Commons
  • 8. Basic Architecture pool relu pool relu output = y(t+1) hidden layer hidden layer regression input = y(t) convolve(input,weights)
  • 9. Parameterized w w w w w w w w w w w w w w w w w w w w w y(t) filter layer 1 T is length of time series t size of intermediate time series W is size of window F is number of filters D is depth of filters F = 6 pool pool pool pool pool pool relu relu relu relu relu relu w w w w w w w w w w w w w w w w w w w w wfilter layer 2 pool pool pool pool pool pool relu relu relu relu relu relu D = 2 W = 24 T = 1512 t = 24 t = 12 t = 6 regression layer w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w y(t+1)
  • 10. Parameter Space Example ● One layer of filters has n*(n + 1)/2 = 6(6-1)/2 = 15 weights ● Two layers = 15 * 2 = 30 filter weight parameters ● Two layers deep and a window of 24 hours = each bottom filter output has 24/2/2 = 6 values ● 6 filters * 6 output values = 36 regression weight parameters ● 66 total parameters ● A network with 24 filters, 3 deep, running on week of hourly of data = 1404
  • 11. Learning About Learning Rate iterations over time learning rate This is a type of stochastic gradient descent with restarts (SGDR)
  • 12. Data and Testing ● Revenue per click data on mobile devices in automotive category ● Hourly data from 4/1/2018 to 6/2/2018 (63 days, 9 weeks of data) ● Train on first 8 weeks of hourly data ● Test on last week of data ● Compared MASE (mean absolute scaled error) of model to MASE of “simple” 1-hour lagged data model ○ MASE < 1.0 means we are beating the simple model
  • 13.
  • 14.
  • 15. Best Network Results ● Using networks with about 6 filters, 3 deep, window of 24 hours of data ● Training took ~20 minutes ● Training on 8 weeks of data ● Best MASE compared to simple 1-hour lag model was ~0.86
  • 16. Prototype Conclusion ● Probably should use GPU framework to make it faster ● Lots of time spent on hyperparameter tuning ● Should consider other network architectures ● Build out in an established NN framework to leverage backpropagation
  • 17. Part 2: Architecture Extension and Production PyTorch Implementation Jeff Roach
  • 18. Goals ● Port to Python ○ PyTorch ○ Fastai ● Find architecture improvements ● Beat current best production model (TBATS) ○ Linear time series model that captures complex seasonal trends ○ Exponential Smoothing State Space Model With Box-Cox Transformation, ARMA Errors, Trend And Seasonal Components ○ TBATS R package to fit model as described in De Livera, Hyndman & Snyder (2011)
  • 19.
  • 20. Architecture w w w y(t) T is length of time series t size of intermediate time series W is size of window F is number of filters F = 1 pool relu w w w pool relu W = 24 T = 1512 w w w w y(t+1) WaveNet ww filter layer 1 filter layer 2 t = 24 in t = 12 out t = 6 in regression layer t = 12 in t = 6 out
  • 21. Architecture w w w w w w w w w w w w w w w w w w w w w y(t) T is length of time series t size of intermediate time series W is size of window F is number of filters F = 6 pool pool pool pool pool pool relu relu relu relu relu relu w w w w w w w w w w w w w w w w w w w w w pool pool pool pool pool pool relu relu relu relu relu relu W = 24 T = 1512 w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w y(t+1) WaveNet Expansion filter layer 1 filter layer 2 t = 24 in t = 12 out t = 6 in regression layer t = 12 in t = 6 out
  • 22. Architecture w w w y(t) T is length of time series t size of intermediate time series W is size of window F is number of filters F = 1 pool relu w w w pool relu W = 24 T = 1512 w w w w y(t+1)www1x filter layer 1 filter layer 2 t = 24 in t = 12 out t = 6 in regression layer t = 12 in t = 6 out WaveNet Expansion
  • 23. Architecture w w w y(t) T is length of time series t size of intermediate time series W is size of window F is number of filters F = 6 pool relu w w w pool relu W = 24 T = 1512 w y(t+1)w24x w12x 6x filter layer 1 filter layer 2 t = 24 in t = 12 out t = 6 in regression layer t = 12 in t = 6 out WaveNet Expansion
  • 24. Architecture w w w y(t) filter layer 1 T is length of time series t size of intermediate time series W is size of window pool relu w w wfilter layer 2 pool relu W = 24 T = 1512 t = 24 in t = 12 out t = 6 in regression layer w y(t+1) Ensemble t = 12 in t = 6 out 108x Dropout BatchNorm (continuous variables) relu dropout Embedding Linear Fully Connected 2x layers 1000, 500 neurons 0.001, 0.01 dropout 0.04 dropout w500x WaveNet fastai’s MixedInputModel Hour as category
  • 25. FilterNet in PyTorch class FilterNet(nn.Module): def __init__(self, emb_szs, n_cont, emb_drop, out_sz, ...): # Wavenet model layers self.c1a = conv_layer(window=window // 2, ks=1, dilation=1) self.c1b = conv_layer(window=window // 4, ks=1, dilation=2) self.c2a = conv_layer(window=window // 2, ks=2, dilation=1) self.c2b = conv_layer(window=window // 4, ks=2, dilation=2) … # Mixed Input model ... # Final layer self.f = Flatten() self.lin = nn.Linear(szs[-1] + 108, out_sz, bias=False) def forward(self, x_win, x_cat, x_cont): # Wavenet model self.f1a = self.c1a(x_win) self.f1b = self.c1b(self.f1a) self.f2a = self.c2a(x_win) self.f2b = self.c2b(self.f2a) … x_wave = torch.cat([self.f1a, self.f1b, self.f2a, ... ], 2) # Mixed Input Model ... x_mix = dropout(x) # Combine results from both nets ... x_comb = torch.cat([x_wave, x_mix], 2) lin_out = self.lin(self.f(x_comb)) return lin_out
  • 26. Model Comparison t-1 Model (Language, Processing Unit) MASE Time TBATS (R, CPU) 0.90 30s WaveNet Expansion (Matlab, CPU) 0.86 1200s WaveNet Expansion (PyTorch, GPU) 0.86 16s FilterNet (PyTorch, GPU) 0.82 27s
  • 27. Model Comparison t-1 Different Category ● Previously trained Automotive category ● Forecasted on Finance category Trained on Automotive data Automotive Finance TBATS (R, CPU) 0.90 0.96 FilterNet (PyTorch, GPU) 0.82 0.90
  • 28. Model Comparison t-1 Missing Data Replaced every nth step with n-1 past data point TBATS FilterNet % diff 2 step (every other) 1.23 1.29 +5% 6 1.03 0.98 -5% 12 0.98 0.91 -7% 24 0.96 0.87 -9% MASE
  • 29. Jagged Dataset ● Jagged ○ Categories use different features ○ Long/short time periods ○ Few/many missing data points ● ~1300 advertising categories ● Hourly data ● Training = 37 days or 888 hours ● Test = 7 days or 168 hours
  • 30. Model Comparison t-1 Jagged MASE Time TBATS, Single Category 0.84 17s FilterNet, Single Category 0.83 4s FilterNet, Full training set (~1300 Categories) 0.78 60s FilterNet, Full training set, test Category removed from training set 0.78 60s
  • 31. Model Comparison t-1 Jagged # of training set days TBATS FilterNet % diff 14 1.30 0.82 -37% 21 1.05 0.86 -18% 28 0.82 0.83 0% 37 0.84 0.83 0% MASE
  • 32. Conclusion ● FilterNet perks ○ Performance (7%) ○ Training speed (10%-300%) ○ Context ○ Less sensitive to data quantity ■ But, more sensitive to data quality ● Convolution and context models are complimentary
  • 34. Prototype Training Detail ● Initialize ○ Seed filter weights with random values from [-1, -0.5, 0, 0.5, 1] ○ Seed regression weights with random values in range -0.2 to 0.2 ○ Set learning rate to 1.0 ● Iterate 100s to 100,000s of times ○ Forward propagate current network and store MSE ○ Randomly select a subset of weights (usually 10%) to move a small amount one at a time ■ Filter weights are moved in random increments of 0.1 or 0.01 ■ Regression weights are moved by another different small amount ■ Store resulting MSE from moving each weight independently ○ Update parameters ■ If MSE for a filter weight delta is lower update it by that random increment ■ If MSE for a regression weight delta is lower update by gradient ○ Update learning rate: multiply by 0.95 ○ If learning rate < threshold set back up to last initial learning rate * 0.95
  • 35.
  • 36.
  • 37. References ● Time Series Wavenet paper ○ https://arxiv.org/pdf/1703.04691.pdf
  • 38. Model Comparison t-1 Facebook MASE Time TBATS, Single Category 0.84 17s FilterNet, Single Category, w/ imputed, Batch Size = 1 1.41 150s FilterNet, Single Category, Batch Size = 1 0.84 150s FilterNet, Single Category, Batch Size = 512 0.83 4s FilterNet, Full training set (~1300 Categories) 0.78 60s FilterNet, Full training set, w/o CNN 0.79 60s FilterNet, Full training set, w/o Mixed Input 0.80 60s FilterNet, Full training set, test Category removed from training set 0.78 60s
  • 39. Production ● Inspired by how fastai loads pretrained models ● Save trained model to dictionary ○ State, structure, tuning parameters, etc. ● Model framework in common location ● Rebuild model using framework and dictionary