SlideShare une entreprise Scribd logo
1  sur  63
Télécharger pour lire hors ligne
Recurrent Graph Convolution Networks for
Forecasting Ethereum prices
ICCS 2018
In collaboration with
tl;dr: We extended Graph Convolution
Networks to be Recurrent over time.
What is Ethereum
- A 100% open source platform to build
and distribute decentralized
applications
- No middle men
- Social sites, Financial systems,
Voting mechanisms, Games,
Reputation Systems
- 100% peer to peer, censorship proof
- Also a Tradable Asset.
RECURRENT GRAPH NEURAL NETWORKS
Experiment Setting
EXPERIMENT SETTING
Time 0 900 1800 2700 3600 4500 5400 6300 7200 8100 9000 9900 10800 11700 12600 13500 14400 15300 16200 17100 18000 18900 19800 … … … … … … … …
Batch - 1
Batch - 2
Batch - 3
Batch - 4
Batch - 5
Batch - 6
Batch - 7
Batch - 8
Batch - 9
…
…
…
Optimization Window Unseen
Vector – 60 Min lagged prices
Ground Truth – ETH Future 5 Min Prices
Batch – Training: 240 Vectors Test: 90 Vectors
In Sample
Training set: 28.02.18 - 13.05.18
Test set: 13.05.18 – 29.05.18
Out of sample
5 (min)60 (min)
Vector Structure
Optimization Window Unseen
Optimization Window Unseen
Optimization Window Unseen
Optimization Window Unseen
Optimization Window Unseen
Optimization Window Unseen
Optimization Window Unseen
Optimization Window Unseen
RECURRENT GRAPH NEURAL NETWORKS
DEEP LEARNING SUPERIORITY
96.92%
Deep Learning
94.9%
Human
ref: http://www.image-net.org/challenges/LSVRC/
RECURRENT GRAPH NEURAL NETWORKS
GRADIENT DESCENT
𝐸 = Error of the network
𝑤𝑡 = 𝑤𝑡−1 − 𝛾
𝜕𝐸
𝜕𝑤
𝑊 = Weight matrix representing the filters
RECURRENT GRAPH NEURAL NETWORKS
BackPropagation
Legend
𝑥0
𝑓0(𝑥0, 𝑤0)
𝑓1(𝑥1, 𝑤1)
𝑓2(𝑥2, 𝑤2)
𝑓𝑛 𝑥 𝑛, 𝑤 𝑛 = ො𝑦
𝑓𝑛−1(𝑥 𝑛−1, 𝑤 𝑛−1)
𝑓𝑛−2(𝑥 𝑛−2, 𝑤 𝑛−2)
𝑤0
𝑤1
𝑤 𝑛
𝑤 𝑛−1
𝐸 = 𝑙 ො𝑦, 𝑦𝑦
𝑙 ො𝑦, 𝑦 - Loss Function
𝑥0 - Features Vector
𝑥𝑖 - Output of 𝑖 layer
𝑤𝑖 - Weights of 𝑖 layer
𝑦 – Ground Truth
ො𝑦 – Model Output
𝐸 – Loss Surface
𝜕𝐸
𝜕𝑥 𝑛
=
𝜕𝑙 ො𝑦, 𝑦
𝜕𝑥 𝑛
𝜕𝐸
𝜕𝑤 𝑛
=
𝜕𝐸
𝜕𝑥 𝑛
𝜕𝑓𝑛 𝑥 𝑛−1, 𝑤 𝑛
𝜕𝑤 𝑛
𝜕𝐸
𝜕𝑥 𝑛−1
=
𝜕𝐸
𝜕𝑥 𝑛
𝜕𝑓𝑛 𝑥 𝑛−1, 𝑤 𝑛
𝑥 𝑛−1
𝑓– Activation Function
𝜕𝐸
𝜕𝑥 𝑛−2
=
𝜕𝐸
𝜕𝑥 𝑛−1
𝜕𝑓𝑛−1 𝑥 𝑛−2, 𝑤 𝑛−1
𝑥 𝑛−2
𝜕𝐸
𝜕𝑤 𝑛−1
=
𝜕𝐸
𝜕𝑥 𝑛−1
𝜕𝑓𝑛 𝑥 𝑛−2, 𝑤 𝑛−1
𝜕𝑤 𝑛−1
…
…
𝐹𝑜𝑟𝑤𝑎𝑟𝑑𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛
𝐵𝑎𝑐𝑘𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛
1: Forward Propagation 2: Loss Calculation 3: Optimization
RECURRENT GRAPH NEURAL NETWORKS
CONVOLUTION
ඵ
−∞−∞
∞∞
𝑓 𝜏1, 𝜏2 ∙ 𝑔 𝑥 − 𝜏1, 𝑦 − 𝜏2 𝑑𝜏1 𝑑𝜏2
𝑓 𝑥, 𝑦 𝑔 𝑥, 𝑦 𝑓 ∗ 𝑔
RECURRENT GRAPH NEURAL NETWORKS
ConvNet
𝑥Input
ො𝑦
Class
Convolution
&
Maxpooling
Convolution
&
Maxpooling
Convolution
&
Maxpooling
Fully Connected
RECURRENT GRAPH NEURAL NETWORKS
F1RMSE PnL(%)
Results: 1D-ConvNet
0.9 0.58 -17.317
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
Recurrent Neural Network
-Memory Achieved through feedback
-Due to self multiplications, Feedback Weight matrix tend to explode or vanish.
-Solution: logistic gating mechanism
Keep
Gate
1.73
Write
Gate
Read
Gate
Input from
rest of RNN
Output to
rest of RNN
Input
Command Output
Cell Gate
RECURRENT GRAPH NEURAL NETWORKS
Recurrent Neural Network
𝒔 𝒕+𝟏𝒔 𝒕 𝒔 𝒕+𝟐…….. ……..Backpropagation
Through Time
Long Short Term
Memory
ቁ𝑓𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑓 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓
ቁ𝜄𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔𝜄 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄
ቁ𝑜𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑜 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜
ቁ𝜍𝑖
𝑙+1
𝑡
= 𝑡𝑎𝑛ℎ( 𝜔𝜍 𝑦𝑗
𝑙
+ 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍
Forget Gate
Output Gate
Input Gate
Cell
RECURRENT GRAPH NEURAL NETWORKS
F1RMSE PnL(%)
Results: LSTM
0.1 0.42 -7.115
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
INPUT
BIDIRECTIONAL GRU
RESIDUAL
DIALATED
CONV1D
𝒈 𝒕+𝟏𝒈 𝒕 𝒈 𝒕+𝟐
𝒈 𝒕+𝟏𝒈 𝒕+𝟐 𝒈 𝒕
TRANSPOSE
AXIS=1
tanh
softmax
tanh
softmax
tanh
softmax
HARD ATTENTION
F1RMSE PnL(%)
Results: CNN-LSTM
0.05 0.53 -7.461
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
CNN?
RNN?
CNN-RNN?
…
DEEP LEARNING COMMON STRUCTURES
SUPERVISED UNSUPERVISED
Perceptron It is a type of linear classifier, a classification algorithm that makes its predictions based on a linear predictor function
combining a set of weights with the feature vector. The algorithm allows for online learning, in that it processes elements in the
training set one at a time.
RECURRENTFEED FORWARD
Feed Forward Network sometimes
Referred to as MLP, is a fully connected
dense model used as a simple
classifier.
Convolutional Network assume that
highly correlated features located close
to each other in the input matrix and
can be pooled and treated as one in the
next layer.
Known for superior Image classification
capabilities.
Simple Recurrent Neural Network is a
class of artificial neural network where
connections between units form a
directed cycle.
Hopfield Recurrent Neural Network It is
a RNN in which all connections are
symmetric. it requires stationary
inputs.
Long Short Term Memory Network
contains gates that determine if the
input is significant enough to
remember, when it should continue to
remember or forget the value, and when
it should output
Auto Encoder aims to learn a
representation (encoding) for a set of
data, typically for the purpose of
dimensionality reduction.
Restricted Boltzmann Machine can
learn a probability distribution over its
set of inputs..
Deep Belief Net is a composition of
simple, unsupervised networks such as
restricted Boltzmann machines ,where
each sub-network's hidden layer serves
as the visible layer for the next.
RECURRENT GRAPH NEURAL NETWORKS
Search Problems
=
=
=
RECURRENT GRAPH NEURAL NETWORKS
Markov Decision Process
Action: 𝒂 𝒕 Action: 𝒂 𝒕+𝟏
Reward : 𝒓 𝒕 Reward : 𝒓 𝒕+𝟏 Reward : 𝒓 𝒕+𝟐
𝒔 𝒕+𝟏𝒔 𝒕 𝒔 𝒕+𝟐…….. ……..
𝑆 ≔ {𝑠1, 𝑠2, 𝑠3, … 𝑠 𝑛}
𝐴 ≔ {𝑎1, 𝑎2, 𝑎3, … 𝑎 𝑛}
𝑇(𝑠, 𝑎, 𝑠𝑡+1)
𝑅(𝑠, 𝑎)
Set of states
Set of Actions
Reward Function
Transition Function
RECURRENT GRAPH NEURAL NETWORKS
Policy Search
𝒔 𝒕 𝝅
𝑸(𝒔, 𝒂)
𝑸(𝒔, 𝒂)
𝑸(𝒔, 𝒂)
𝑸(𝒔, 𝒂)
Policy Expected Reward
𝝅: 𝒔 → 𝒂
The goal will be to
Maximize the reward
RECURRENT GRAPH NEURAL NETWORKS
Reinforcement Learning
Observation
Action
Value – Maps state, action pair to expected future reward
𝑸 𝒔, 𝒂 ≈ 𝔼 𝑹 𝒕+𝟏 + 𝑹 𝒕+𝟐 + 𝑹 𝒕+𝟑 + … 𝑺𝒕 = 𝒔, 𝑨 𝒕 = 𝒂]
Optimal Value – Bellman Equation 1957
𝑸∗
𝒔, 𝒂 ≈ 𝔼 𝑹 𝒕+𝟏 𝑸∗
(𝑺𝒕+𝟏, 𝒃) 𝑺 𝒕 = 𝒔, 𝑨 𝒕 = 𝒂]
TD Algorithm – Watkins 1989
𝑸 𝒕+𝟏 𝑺𝒕, 𝑨 𝒕 = 𝑸 𝒕 𝑺 𝒕, 𝑨 𝒕 + 𝜶(𝑹 𝒕+𝟏 + γmax
𝑎
𝑸 𝒕 𝑺𝒕+𝟏, 𝑨 𝒕 − 𝑸 𝒕 𝑺𝒕, 𝑨 𝒕 ]
RECURRENT GRAPH NEURAL NETWORKS
Gets “Rewards” and Penalties based on
it’s success of producing a better
generation of models.
Father Model
Being built, compiled, evaluated and
stored for future reconstruction and
retraining by a Human.
Child Model
Deep
Reinforcement
Learning
Deep Meta Learning
RECURRENT GRAPH NEURAL NETWORKS
F1RMSE PnL(%)
Results: Deep Meta Learning
0.027 0.68 -3.2
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
Reward Shaping
Random Walk LSTM
RECURRENT GRAPH NEURAL NETWORKS
<hash> <hash>
<hash> <hash>
<hash> <hash>
<hash> <hash>
<hash> <hash>
<hash> <hash>
<Amount>
<Amount>
<Amount>
<Amount>
<Amount>
<Amount>
…
…
Blockchain Representation
Learning Graph Representations
Random Walks On Graphs
Perozzi et al., 2014
Spectral networks
Bruna et al., 2013
Marginalized kernels between labeled graphs
Kashima, 2013
Graph Neural Networks
Gori 2015
Convolutional Networks on Graphs for
Learning Molecular Fingerprints
Duvenaud, 2015
RECURRENT GRAPH NEURAL NETWORKS
Spectral Networks
Convolution are diagonalized in Fourier Domain:
𝒙 ∗ 𝒉 = 𝓕−𝟏 𝒅𝒊𝒂𝒈 𝓕𝒉 𝓕𝒙
Where
𝓕 𝒌,𝒍 = 𝒆
(
−𝟐𝝅𝒊(𝒌∙𝒍)
𝑵 𝒅 )
Fourier basis can be defined as the eigenbasis of
Laplacian operator:
∆𝒙 𝒖 = ෍
𝒋≤𝒅
𝝏 𝟐 𝒙
𝝏𝒖𝒋
𝟐
(𝒖)
RECURRENT GRAPH NEURAL NETWORKS
Laplacian
𝑓
𝑓′
𝑓′′
𝛻𝑓
𝛻 ∙
𝐺𝑟𝑎𝑑𝑖𝑒𝑛𝑡
𝐷𝑖𝑣𝑒𝑟𝑔𝑒𝑛𝑐𝑒
RECURRENT GRAPH NEURAL NETWORKS
Graph Laplacian
RECURRENT GRAPH NEURAL NETWORKS
Graph Convolution
Spectral graph convolution
multiplication of a signal with a filter in the Fourier space of a graph.
Graph Fourier transform
multiplication of a graph signal 𝑋(i.e. feature vectors for every node)
with the eigenvector matrix 𝑈of the graph Laplacian 𝐿.
Graph Laplacian
can be easily computed from the symmetrically normalized graph adjacency
matrix ҧ𝐴: 𝐿 = 𝐼 − ҧ𝐴
Fourier basis of 𝑿 are Eigenvectors 𝑽 of 𝑳
RECURRENT GRAPH NEURAL NETWORKS
Spectral Networks
Convolution of Graph:
𝒙 ∗ 𝒉 𝒌 = 𝑽𝒅𝒊𝒂𝒈(𝒉)𝑽 𝑻
𝒙
RECURRENT GRAPH NEURAL NETWORKS
Translation Invariance?
Graphs Isomorphism
RECURRENT GRAPH NEURAL NETWORKS
ConvNet (LeNet5)
𝑥Input
ො𝑦
Class
Convolution
&
Maxpooling
Convolution
&
Maxpooling
Convolution
&
Maxpooling
Fully Connected
RECURRENT GRAPH NEURAL NETWORKS
ConvNet (LeNet)
𝑥Input
ො𝑦
Class
Convolution
&
Maxpooling
Convolution
&
Maxpooling
Convolution
&
Maxpooling
Fully Connected
Classifier
Representation
Learning
RECURRENT GRAPH NEURAL NETWORKS
Representation Bank
Give me the best
representation
for “cat”
the best
representation
for “cat”
Cat
RECURRENT GRAPH NEURAL NETWORKS
Single CNN layer with 3X3 filter
Convolutional Neural Network
2D
1D
RECURRENT GRAPH NEURAL NETWORKS
Single CNN layer with 3X3 filter
Euclidian Space Convolution
Update for a single pixel
-Transform neighbors individually 𝑤𝑖
(𝑙)
ℎ𝑖
(𝑙)
-Add everything up σ𝑖 𝑤𝑖
(𝑙)
ℎ𝑖
(𝑙)
-Add everything up ℎ0
(𝑙+1)
= 𝜎(σ𝑖 𝑤𝑖
(𝑙)
ℎ𝑖
(𝑙)
)
𝒉 𝟎
𝒉 𝟐𝒉 𝟏 𝒉 𝟑
𝒉 𝟒
𝒉 𝟓𝒉 𝟔𝒉 𝟕
𝒉 𝟖
𝑤7
𝑤8
𝑤1 𝑤2
𝑤3
𝑤4
𝑤5𝑤6
RECURRENT GRAPH NEURAL NETWORKS
Euclidian Space Convolution
𝒉 𝟎
𝒉 𝟐𝒉 𝟏 𝒉 𝟑
𝒉 𝟒
𝒉 𝟓𝒉 𝟔𝒉 𝟕
𝒉 𝟖
𝑤7
𝑤8
𝑤1 𝑤2
𝑤3
𝑤4
𝑤5𝑤6
ℎ0
(𝑙+1)
= 𝜎(෍
𝑖
𝑤𝑖
(𝑙)
ℎ𝑖
(𝑙)
)
RECURRENT GRAPH NEURAL NETWORKS
Graph Convolution as Message Passing
𝒉 𝟎
(𝒍+𝟏)
= 𝝈(𝒉 𝟎
(𝒍)
𝒘 𝟎
(𝒍)
෍
𝒊∈𝝒
𝟏
𝒄𝒊,𝒍
𝒘𝒋
(𝒍)
𝒉𝒋
(𝒍)
)
Propagation rule
𝒘 𝟎
𝒘 𝟏
𝒉𝒊
RECURRENT GRAPH NEURAL NETWORKS
def relational_graph_convolution(self, inputs):
features = inputs[0]
A = inputs[1:] # list of basis functions
# convolve
supports = list()
for i in range(support):
supports.append(K.dot(A[i], features))
supports = K.concatenate(supports, axis=1)
output = K.dot(supports, self.W)
𝒉 𝟎
(𝒍+𝟏)
= 𝝈(𝒉 𝟎
(𝒍)
𝒘 𝟎
(𝒍)
෍
𝒊∈𝝒
𝟏
𝒄𝒊,𝒍
𝒘𝒋
(𝒍)
𝒉𝒋
(𝒍)
)
RECURRENT GRAPH NEURAL NETWORKS
GRAPH CONVOLUTIONAL NETWORKS
ReLUReLU
Input
Features for nodes
𝑋 ∈ ℝ 𝑁∗𝐸
Adjacency matrix
containing all links መ𝐴
Embeddings
Representations that combine features of
neighborhood
Neighborhood size depends on number of
layers
RECURRENT GRAPH NEURAL NETWORKS
Problem
Embeddings are not optimized
For classification task!
GRAPH CONVOLUTIONAL NETWORKS
ReLUReLU
Input
Features for nodes
𝑋 ∈ ℝ 𝑁∗𝐸
Adjacency matrix
containing all links መ𝐴
Evaluate loss on labeled nodes only
ℒ = − ෍
𝐼∈𝑦 𝑖
෍
𝑓=𝐼
𝐹
𝑌𝐼𝑓ln(෍
𝑖
𝑒 𝑥 𝑖)
RECURRENT GRAPH NEURAL NETWORKS
EXAMPLE OF FORWARD PASS
𝑓( ) =
RECURRENT GRAPH NEURAL NETWORKS
Inits
SEMI-SUPERVISED CLASSIFICATION WITH
GRAPH CONVOLUTIONAL NETWORKS
Move
Nodes
https://github.com/tkipf/gcn
RECURRENT GRAPH NEURAL NETWORKS
Inits
SEMI-SUPERVISED CLASSIFICATION WITH
GRAPH CONVOLUTIONAL NETWORKS
Move
Nodes
https://github.com/tkipf/gcn
𝒉 𝟎
(𝒍+𝟏)
= 𝝈(෍
𝒊∈𝝒
𝟏
𝒄𝒊,𝒍
𝒘 𝟏
(𝒍)
𝒉𝒋
(𝒍)
)
RECURRENT GRAPH NEURAL NETWORKS
F1RMSE PnL(%)
Results: Graph Convolution
0.037 0.71 0.3
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
Temporal?
Recurrent Neural Networks Graph Convolution Networks
𝒘 𝟎
𝒘 𝟏
𝒉𝒊
𝒉 𝟎
(𝒍+𝟏)
= 𝝈(𝒉 𝟎
(𝒍)
𝒘 𝟎
(𝒍)
෍
𝒊∈𝝒
𝟏
𝒄𝒊,𝒍
𝒘𝒋
(𝒍)
𝒉𝒋
(𝒍)
)
ቁ𝑓𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑓 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓
ቁ𝜄𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔𝜄 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄
ቁ𝑜𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑜 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜
ቁ𝜍𝑖
𝑙+1
𝑡
= 𝑡𝑎𝑛ℎ( 𝜔𝜍 𝑦𝑗
𝑙
+ 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍
Recurrent Neural Networks Graph Convolution Networks
𝒉 𝟎
(𝒍+𝟏)
= 𝝈(𝒉 𝟎
(𝒍)
𝒘 𝟎
(𝒍)
෍
𝒊∈𝝒
𝟏
𝒄𝒊,𝒍
𝒘𝒋
(𝒍)
𝒉𝒋
(𝒍)
)
ቁ𝑓𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑓 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓
ቁ𝜄𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔𝜄 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄
ቁ𝑜𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑜 𝑦𝑗
𝑙
𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜
ቁ𝜍𝑖
𝑙+1
𝑡
= 𝑡𝑎𝑛ℎ( 𝜔𝜍 𝑦𝑗
𝑙
+ 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍
൱𝑓𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑓 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓
൱𝜄𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔𝜄 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄
൱𝑜𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑜 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜
൱𝜍𝑖
𝑙+1
𝑡
= 𝑡𝑎𝑛ℎ( 𝜔𝜍 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
+ 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍
Forget Gate
Output Gate
Input Gate
Cell
RECURRENT GRAPH CONVOLUTIONAL NETWORKS
RECURRENT GRAPH NEURAL NETWORKS
൱𝑓𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑓 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓
൱𝜄𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔𝜄 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄
൱𝑜𝑖
𝑙+1
𝑡
= 𝜎𝑔( 𝜔 𝑜 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜
൱𝜍𝑖
𝑙+1
𝑡
= 𝑡𝑎𝑛ℎ( 𝜔𝜍 ෍
𝑟∈ℛ
൱෍
𝑗∈𝒩𝑖
𝑟
1
𝑐𝑖,𝑟
𝜃𝑟
𝑙
𝑦𝑗
𝑙
+ 𝜃0
𝑙
𝑦𝑖
𝑙
+ 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍
Forget Gate
Output Gate
Input Gate
Cell
ℎ 𝑡 ℎ 𝑡+1 ℎ 𝑡+2 ℎ 𝑡+3
F1RMSE PnL(%)
Results: Recurrent Graph Convolution
0.028 0.77 2.4
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
STRATEGY GRADIENT?
𝜕( 𝜃)
𝜕𝜃
−
𝜕( 𝜑)
𝜕𝜑
Returns Risk
RECURRENT GRAPH NEURAL NETWORKS
Graph Auto Encoders
𝑨 – input graph
𝒙 – input node
෡𝑨 – output graph
Useful for predicting connectivity links
RECURRENT GRAPH NEURAL NETWORKS
Recommender Systems
Users
Items
Graph
Representation
Graph
Prediction
Graph
AutoEncoder
RECURRENT GRAPH NEURAL NETWORKS
𝜎
μ
Simulation
TRADING STRATEGY GRADIENTS
෍
𝑖=1
𝑛
𝜎𝑖
2
+ 𝜇𝑖
2
− log 𝜎𝑖 − 1
| ො𝑦 − 𝑦| 2
2
Action:
𝒂 𝒕+𝟏
RECURRENT GRAPH NEURAL NETWORKS
F1RMSE PnL(%)
Results: Recurrent Graph Auto Encoder
0.024 0.86 5.6
Results for out of sample simulated trading
Simple root mean square error F1-beta score (Harmonic mean of
precision and recall) taken as
classification decision where the
predicted price is greater then the
current price +15% transaction fee.
Profits and losses (percentage) for
out of sample trading.
Assuming 15% transaction fee.
RECURRENT GRAPH NEURAL NETWORKS
Conclusions
-Deep Learning works well on Euclidean data.
-Attempts to utilize DL for Non-Euclidean are starting to become viable.
-Reward shaping and drifted metrics are extremely misleading.
-After trying heavily we conclude that Aggregated data (prices) of Ethereum is
insufficient when trying to forecast behavior.
-We introduce a novel layer: Recurrent Graph Convolution and demonstrate
How this approach yield “tradable” results.
RECURRENT GRAPH NEURAL NETWORKS
FIN

Contenu connexe

Tendances

Tendances (20)

increasing the action gap - new operators for reinforcement learning
increasing the action gap - new operators for reinforcement learningincreasing the action gap - new operators for reinforcement learning
increasing the action gap - new operators for reinforcement learning
 
Deep Learning in Finance
Deep Learning in FinanceDeep Learning in Finance
Deep Learning in Finance
 
方策勾配型強化学習の基礎と応用
方策勾配型強化学習の基礎と応用方策勾配型強化学習の基礎と応用
方策勾配型強化学習の基礎と応用
 
自然方策勾配法の基礎と応用
自然方策勾配法の基礎と応用自然方策勾配法の基礎と応用
自然方策勾配法の基礎と応用
 
Convolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in TheanoConvolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in Theano
 
Hands-on Tutorial of Machine Learning in Python
Hands-on Tutorial of Machine Learning in PythonHands-on Tutorial of Machine Learning in Python
Hands-on Tutorial of Machine Learning in Python
 
Playing Atari with Deep Reinforcement Learning
Playing Atari with Deep Reinforcement LearningPlaying Atari with Deep Reinforcement Learning
Playing Atari with Deep Reinforcement Learning
 
Continuous control with deep reinforcement learning (DDPG)
Continuous control with deep reinforcement learning (DDPG)Continuous control with deep reinforcement learning (DDPG)
Continuous control with deep reinforcement learning (DDPG)
 
Lecture 5: Neural Networks II
Lecture 5: Neural Networks IILecture 5: Neural Networks II
Lecture 5: Neural Networks II
 
Workshop - Introduction to Machine Learning with R
Workshop - Introduction to Machine Learning with RWorkshop - Introduction to Machine Learning with R
Workshop - Introduction to Machine Learning with R
 
Generalized Reinforcement Learning
Generalized Reinforcement LearningGeneralized Reinforcement Learning
Generalized Reinforcement Learning
 
ddpg seminar
ddpg seminarddpg seminar
ddpg seminar
 
AI optimizing HPC simulations (presentation from 6th EULAG Workshop)
AI optimizing HPC simulations (presentation from  6th EULAG Workshop)AI optimizing HPC simulations (presentation from  6th EULAG Workshop)
AI optimizing HPC simulations (presentation from 6th EULAG Workshop)
 
Capsule networks
Capsule networksCapsule networks
Capsule networks
 
Rabbit challenge 5_dnn3
Rabbit challenge 5_dnn3Rabbit challenge 5_dnn3
Rabbit challenge 5_dnn3
 
Dssg talk CNN intro
Dssg talk CNN introDssg talk CNN intro
Dssg talk CNN intro
 
Deep Learning for AI (2)
Deep Learning for AI (2)Deep Learning for AI (2)
Deep Learning for AI (2)
 
Ultrasound nerve segmentation, kaggle review
Ultrasound nerve segmentation, kaggle reviewUltrasound nerve segmentation, kaggle review
Ultrasound nerve segmentation, kaggle review
 
PPT - AutoML-Zero: Evolving Machine Learning Algorithms From Scratch
PPT - AutoML-Zero: Evolving Machine Learning Algorithms From ScratchPPT - AutoML-Zero: Evolving Machine Learning Algorithms From Scratch
PPT - AutoML-Zero: Evolving Machine Learning Algorithms From Scratch
 
BMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialBMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorial
 

Similaire à Learning Graphs Representations Using Recurrent Graph Convolution Networks For Forecasting Ethereum Prices

pptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspacespptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
butest
 
pptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspacespptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
butest
 
Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
SanjanaSaxena17
 

Similaire à Learning Graphs Representations Using Recurrent Graph Convolution Networks For Forecasting Ethereum Prices (20)

Batch normalization presentation
Batch normalization presentationBatch normalization presentation
Batch normalization presentation
 
pptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspacespptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
 
pptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspacespptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
 
All projects
All projectsAll projects
All projects
 
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
HRNET : Deep High-Resolution Representation Learning for Human Pose EstimationHRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
 
Lesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdfLesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdf
 
2021 06-02-tabnet
2021 06-02-tabnet2021 06-02-tabnet
2021 06-02-tabnet
 
Network predictive analysis
Network predictive analysisNetwork predictive analysis
Network predictive analysis
 
Josh Patterson MLconf slides
Josh Patterson MLconf slidesJosh Patterson MLconf slides
Josh Patterson MLconf slides
 
Deep Learning with Apache MXNet (September 2017)
Deep Learning with Apache MXNet (September 2017)Deep Learning with Apache MXNet (September 2017)
Deep Learning with Apache MXNet (September 2017)
 
Big data 2.0, deep learning and financial Usecases
Big data 2.0, deep learning and financial UsecasesBig data 2.0, deep learning and financial Usecases
Big data 2.0, deep learning and financial Usecases
 
Introduction to Tensor Flow for Optical Character Recognition (OCR)
Introduction to Tensor Flow for Optical Character Recognition (OCR)Introduction to Tensor Flow for Optical Character Recognition (OCR)
Introduction to Tensor Flow for Optical Character Recognition (OCR)
 
Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
 
Machine learning
Machine learningMachine learning
Machine learning
 
Artificial neural networks introduction
Artificial neural networks introductionArtificial neural networks introduction
Artificial neural networks introduction
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Restricting the Flow: Information Bottlenecks for Attribution
Restricting the Flow: Information Bottlenecks for AttributionRestricting the Flow: Information Bottlenecks for Attribution
Restricting the Flow: Information Bottlenecks for Attribution
 
Safety Verification of Deep Neural Networks_.pdf
Safety Verification of Deep Neural Networks_.pdfSafety Verification of Deep Neural Networks_.pdf
Safety Verification of Deep Neural Networks_.pdf
 
Intel Nervana Artificial Intelligence Meetup 1/31/17
Intel Nervana Artificial Intelligence Meetup 1/31/17Intel Nervana Artificial Intelligence Meetup 1/31/17
Intel Nervana Artificial Intelligence Meetup 1/31/17
 
Handwritten digits recognition report
Handwritten digits recognition reportHandwritten digits recognition report
Handwritten digits recognition report
 

Dernier

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Learning Graphs Representations Using Recurrent Graph Convolution Networks For Forecasting Ethereum Prices

  • 1. Recurrent Graph Convolution Networks for Forecasting Ethereum prices ICCS 2018 In collaboration with
  • 2. tl;dr: We extended Graph Convolution Networks to be Recurrent over time.
  • 3. What is Ethereum - A 100% open source platform to build and distribute decentralized applications - No middle men - Social sites, Financial systems, Voting mechanisms, Games, Reputation Systems - 100% peer to peer, censorship proof - Also a Tradable Asset. RECURRENT GRAPH NEURAL NETWORKS
  • 5. EXPERIMENT SETTING Time 0 900 1800 2700 3600 4500 5400 6300 7200 8100 9000 9900 10800 11700 12600 13500 14400 15300 16200 17100 18000 18900 19800 … … … … … … … … Batch - 1 Batch - 2 Batch - 3 Batch - 4 Batch - 5 Batch - 6 Batch - 7 Batch - 8 Batch - 9 … … … Optimization Window Unseen Vector – 60 Min lagged prices Ground Truth – ETH Future 5 Min Prices Batch – Training: 240 Vectors Test: 90 Vectors In Sample Training set: 28.02.18 - 13.05.18 Test set: 13.05.18 – 29.05.18 Out of sample 5 (min)60 (min) Vector Structure Optimization Window Unseen Optimization Window Unseen Optimization Window Unseen Optimization Window Unseen Optimization Window Unseen Optimization Window Unseen Optimization Window Unseen Optimization Window Unseen RECURRENT GRAPH NEURAL NETWORKS
  • 6. DEEP LEARNING SUPERIORITY 96.92% Deep Learning 94.9% Human ref: http://www.image-net.org/challenges/LSVRC/ RECURRENT GRAPH NEURAL NETWORKS
  • 7. GRADIENT DESCENT 𝐸 = Error of the network 𝑤𝑡 = 𝑤𝑡−1 − 𝛾 𝜕𝐸 𝜕𝑤 𝑊 = Weight matrix representing the filters RECURRENT GRAPH NEURAL NETWORKS
  • 8. BackPropagation Legend 𝑥0 𝑓0(𝑥0, 𝑤0) 𝑓1(𝑥1, 𝑤1) 𝑓2(𝑥2, 𝑤2) 𝑓𝑛 𝑥 𝑛, 𝑤 𝑛 = ො𝑦 𝑓𝑛−1(𝑥 𝑛−1, 𝑤 𝑛−1) 𝑓𝑛−2(𝑥 𝑛−2, 𝑤 𝑛−2) 𝑤0 𝑤1 𝑤 𝑛 𝑤 𝑛−1 𝐸 = 𝑙 ො𝑦, 𝑦𝑦 𝑙 ො𝑦, 𝑦 - Loss Function 𝑥0 - Features Vector 𝑥𝑖 - Output of 𝑖 layer 𝑤𝑖 - Weights of 𝑖 layer 𝑦 – Ground Truth ො𝑦 – Model Output 𝐸 – Loss Surface 𝜕𝐸 𝜕𝑥 𝑛 = 𝜕𝑙 ො𝑦, 𝑦 𝜕𝑥 𝑛 𝜕𝐸 𝜕𝑤 𝑛 = 𝜕𝐸 𝜕𝑥 𝑛 𝜕𝑓𝑛 𝑥 𝑛−1, 𝑤 𝑛 𝜕𝑤 𝑛 𝜕𝐸 𝜕𝑥 𝑛−1 = 𝜕𝐸 𝜕𝑥 𝑛 𝜕𝑓𝑛 𝑥 𝑛−1, 𝑤 𝑛 𝑥 𝑛−1 𝑓– Activation Function 𝜕𝐸 𝜕𝑥 𝑛−2 = 𝜕𝐸 𝜕𝑥 𝑛−1 𝜕𝑓𝑛−1 𝑥 𝑛−2, 𝑤 𝑛−1 𝑥 𝑛−2 𝜕𝐸 𝜕𝑤 𝑛−1 = 𝜕𝐸 𝜕𝑥 𝑛−1 𝜕𝑓𝑛 𝑥 𝑛−2, 𝑤 𝑛−1 𝜕𝑤 𝑛−1 … … 𝐹𝑜𝑟𝑤𝑎𝑟𝑑𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝐵𝑎𝑐𝑘𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 1: Forward Propagation 2: Loss Calculation 3: Optimization RECURRENT GRAPH NEURAL NETWORKS
  • 9. CONVOLUTION ඵ −∞−∞ ∞∞ 𝑓 𝜏1, 𝜏2 ∙ 𝑔 𝑥 − 𝜏1, 𝑦 − 𝜏2 𝑑𝜏1 𝑑𝜏2 𝑓 𝑥, 𝑦 𝑔 𝑥, 𝑦 𝑓 ∗ 𝑔 RECURRENT GRAPH NEURAL NETWORKS
  • 11. F1RMSE PnL(%) Results: 1D-ConvNet 0.9 0.58 -17.317 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 12. Recurrent Neural Network -Memory Achieved through feedback -Due to self multiplications, Feedback Weight matrix tend to explode or vanish. -Solution: logistic gating mechanism Keep Gate 1.73 Write Gate Read Gate Input from rest of RNN Output to rest of RNN Input Command Output Cell Gate RECURRENT GRAPH NEURAL NETWORKS
  • 13. Recurrent Neural Network 𝒔 𝒕+𝟏𝒔 𝒕 𝒔 𝒕+𝟐…….. ……..Backpropagation Through Time Long Short Term Memory ቁ𝑓𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑓 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓 ቁ𝜄𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔𝜄 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄 ቁ𝑜𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑜 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜 ቁ𝜍𝑖 𝑙+1 𝑡 = 𝑡𝑎𝑛ℎ( 𝜔𝜍 𝑦𝑗 𝑙 + 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍 Forget Gate Output Gate Input Gate Cell RECURRENT GRAPH NEURAL NETWORKS
  • 14. F1RMSE PnL(%) Results: LSTM 0.1 0.42 -7.115 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 15. INPUT BIDIRECTIONAL GRU RESIDUAL DIALATED CONV1D 𝒈 𝒕+𝟏𝒈 𝒕 𝒈 𝒕+𝟐 𝒈 𝒕+𝟏𝒈 𝒕+𝟐 𝒈 𝒕 TRANSPOSE AXIS=1 tanh softmax tanh softmax tanh softmax HARD ATTENTION
  • 16. F1RMSE PnL(%) Results: CNN-LSTM 0.05 0.53 -7.461 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 18. DEEP LEARNING COMMON STRUCTURES SUPERVISED UNSUPERVISED Perceptron It is a type of linear classifier, a classification algorithm that makes its predictions based on a linear predictor function combining a set of weights with the feature vector. The algorithm allows for online learning, in that it processes elements in the training set one at a time. RECURRENTFEED FORWARD Feed Forward Network sometimes Referred to as MLP, is a fully connected dense model used as a simple classifier. Convolutional Network assume that highly correlated features located close to each other in the input matrix and can be pooled and treated as one in the next layer. Known for superior Image classification capabilities. Simple Recurrent Neural Network is a class of artificial neural network where connections between units form a directed cycle. Hopfield Recurrent Neural Network It is a RNN in which all connections are symmetric. it requires stationary inputs. Long Short Term Memory Network contains gates that determine if the input is significant enough to remember, when it should continue to remember or forget the value, and when it should output Auto Encoder aims to learn a representation (encoding) for a set of data, typically for the purpose of dimensionality reduction. Restricted Boltzmann Machine can learn a probability distribution over its set of inputs.. Deep Belief Net is a composition of simple, unsupervised networks such as restricted Boltzmann machines ,where each sub-network's hidden layer serves as the visible layer for the next. RECURRENT GRAPH NEURAL NETWORKS
  • 20. Markov Decision Process Action: 𝒂 𝒕 Action: 𝒂 𝒕+𝟏 Reward : 𝒓 𝒕 Reward : 𝒓 𝒕+𝟏 Reward : 𝒓 𝒕+𝟐 𝒔 𝒕+𝟏𝒔 𝒕 𝒔 𝒕+𝟐…….. …….. 𝑆 ≔ {𝑠1, 𝑠2, 𝑠3, … 𝑠 𝑛} 𝐴 ≔ {𝑎1, 𝑎2, 𝑎3, … 𝑎 𝑛} 𝑇(𝑠, 𝑎, 𝑠𝑡+1) 𝑅(𝑠, 𝑎) Set of states Set of Actions Reward Function Transition Function RECURRENT GRAPH NEURAL NETWORKS
  • 21. Policy Search 𝒔 𝒕 𝝅 𝑸(𝒔, 𝒂) 𝑸(𝒔, 𝒂) 𝑸(𝒔, 𝒂) 𝑸(𝒔, 𝒂) Policy Expected Reward 𝝅: 𝒔 → 𝒂 The goal will be to Maximize the reward RECURRENT GRAPH NEURAL NETWORKS
  • 22. Reinforcement Learning Observation Action Value – Maps state, action pair to expected future reward 𝑸 𝒔, 𝒂 ≈ 𝔼 𝑹 𝒕+𝟏 + 𝑹 𝒕+𝟐 + 𝑹 𝒕+𝟑 + … 𝑺𝒕 = 𝒔, 𝑨 𝒕 = 𝒂] Optimal Value – Bellman Equation 1957 𝑸∗ 𝒔, 𝒂 ≈ 𝔼 𝑹 𝒕+𝟏 𝑸∗ (𝑺𝒕+𝟏, 𝒃) 𝑺 𝒕 = 𝒔, 𝑨 𝒕 = 𝒂] TD Algorithm – Watkins 1989 𝑸 𝒕+𝟏 𝑺𝒕, 𝑨 𝒕 = 𝑸 𝒕 𝑺 𝒕, 𝑨 𝒕 + 𝜶(𝑹 𝒕+𝟏 + γmax 𝑎 𝑸 𝒕 𝑺𝒕+𝟏, 𝑨 𝒕 − 𝑸 𝒕 𝑺𝒕, 𝑨 𝒕 ] RECURRENT GRAPH NEURAL NETWORKS
  • 23. Gets “Rewards” and Penalties based on it’s success of producing a better generation of models. Father Model Being built, compiled, evaluated and stored for future reconstruction and retraining by a Human. Child Model Deep Reinforcement Learning Deep Meta Learning RECURRENT GRAPH NEURAL NETWORKS
  • 24.
  • 25. F1RMSE PnL(%) Results: Deep Meta Learning 0.027 0.68 -3.2 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 26. Reward Shaping Random Walk LSTM RECURRENT GRAPH NEURAL NETWORKS
  • 27.
  • 28. <hash> <hash> <hash> <hash> <hash> <hash> <hash> <hash> <hash> <hash> <hash> <hash> <Amount> <Amount> <Amount> <Amount> <Amount> <Amount> … … Blockchain Representation
  • 29. Learning Graph Representations Random Walks On Graphs Perozzi et al., 2014 Spectral networks Bruna et al., 2013 Marginalized kernels between labeled graphs Kashima, 2013 Graph Neural Networks Gori 2015 Convolutional Networks on Graphs for Learning Molecular Fingerprints Duvenaud, 2015 RECURRENT GRAPH NEURAL NETWORKS
  • 30. Spectral Networks Convolution are diagonalized in Fourier Domain: 𝒙 ∗ 𝒉 = 𝓕−𝟏 𝒅𝒊𝒂𝒈 𝓕𝒉 𝓕𝒙 Where 𝓕 𝒌,𝒍 = 𝒆 ( −𝟐𝝅𝒊(𝒌∙𝒍) 𝑵 𝒅 ) Fourier basis can be defined as the eigenbasis of Laplacian operator: ∆𝒙 𝒖 = ෍ 𝒋≤𝒅 𝝏 𝟐 𝒙 𝝏𝒖𝒋 𝟐 (𝒖) RECURRENT GRAPH NEURAL NETWORKS
  • 33. Graph Convolution Spectral graph convolution multiplication of a signal with a filter in the Fourier space of a graph. Graph Fourier transform multiplication of a graph signal 𝑋(i.e. feature vectors for every node) with the eigenvector matrix 𝑈of the graph Laplacian 𝐿. Graph Laplacian can be easily computed from the symmetrically normalized graph adjacency matrix ҧ𝐴: 𝐿 = 𝐼 − ҧ𝐴 Fourier basis of 𝑿 are Eigenvectors 𝑽 of 𝑳 RECURRENT GRAPH NEURAL NETWORKS
  • 34. Spectral Networks Convolution of Graph: 𝒙 ∗ 𝒉 𝒌 = 𝑽𝒅𝒊𝒂𝒈(𝒉)𝑽 𝑻 𝒙 RECURRENT GRAPH NEURAL NETWORKS
  • 39. Representation Bank Give me the best representation for “cat” the best representation for “cat” Cat RECURRENT GRAPH NEURAL NETWORKS
  • 40. Single CNN layer with 3X3 filter Convolutional Neural Network 2D 1D RECURRENT GRAPH NEURAL NETWORKS
  • 41. Single CNN layer with 3X3 filter Euclidian Space Convolution Update for a single pixel -Transform neighbors individually 𝑤𝑖 (𝑙) ℎ𝑖 (𝑙) -Add everything up σ𝑖 𝑤𝑖 (𝑙) ℎ𝑖 (𝑙) -Add everything up ℎ0 (𝑙+1) = 𝜎(σ𝑖 𝑤𝑖 (𝑙) ℎ𝑖 (𝑙) ) 𝒉 𝟎 𝒉 𝟐𝒉 𝟏 𝒉 𝟑 𝒉 𝟒 𝒉 𝟓𝒉 𝟔𝒉 𝟕 𝒉 𝟖 𝑤7 𝑤8 𝑤1 𝑤2 𝑤3 𝑤4 𝑤5𝑤6 RECURRENT GRAPH NEURAL NETWORKS
  • 42. Euclidian Space Convolution 𝒉 𝟎 𝒉 𝟐𝒉 𝟏 𝒉 𝟑 𝒉 𝟒 𝒉 𝟓𝒉 𝟔𝒉 𝟕 𝒉 𝟖 𝑤7 𝑤8 𝑤1 𝑤2 𝑤3 𝑤4 𝑤5𝑤6 ℎ0 (𝑙+1) = 𝜎(෍ 𝑖 𝑤𝑖 (𝑙) ℎ𝑖 (𝑙) ) RECURRENT GRAPH NEURAL NETWORKS
  • 43. Graph Convolution as Message Passing 𝒉 𝟎 (𝒍+𝟏) = 𝝈(𝒉 𝟎 (𝒍) 𝒘 𝟎 (𝒍) ෍ 𝒊∈𝝒 𝟏 𝒄𝒊,𝒍 𝒘𝒋 (𝒍) 𝒉𝒋 (𝒍) ) Propagation rule 𝒘 𝟎 𝒘 𝟏 𝒉𝒊 RECURRENT GRAPH NEURAL NETWORKS
  • 44. def relational_graph_convolution(self, inputs): features = inputs[0] A = inputs[1:] # list of basis functions # convolve supports = list() for i in range(support): supports.append(K.dot(A[i], features)) supports = K.concatenate(supports, axis=1) output = K.dot(supports, self.W) 𝒉 𝟎 (𝒍+𝟏) = 𝝈(𝒉 𝟎 (𝒍) 𝒘 𝟎 (𝒍) ෍ 𝒊∈𝝒 𝟏 𝒄𝒊,𝒍 𝒘𝒋 (𝒍) 𝒉𝒋 (𝒍) ) RECURRENT GRAPH NEURAL NETWORKS
  • 45. GRAPH CONVOLUTIONAL NETWORKS ReLUReLU Input Features for nodes 𝑋 ∈ ℝ 𝑁∗𝐸 Adjacency matrix containing all links መ𝐴 Embeddings Representations that combine features of neighborhood Neighborhood size depends on number of layers RECURRENT GRAPH NEURAL NETWORKS
  • 46. Problem Embeddings are not optimized For classification task!
  • 47. GRAPH CONVOLUTIONAL NETWORKS ReLUReLU Input Features for nodes 𝑋 ∈ ℝ 𝑁∗𝐸 Adjacency matrix containing all links መ𝐴 Evaluate loss on labeled nodes only ℒ = − ෍ 𝐼∈𝑦 𝑖 ෍ 𝑓=𝐼 𝐹 𝑌𝐼𝑓ln(෍ 𝑖 𝑒 𝑥 𝑖) RECURRENT GRAPH NEURAL NETWORKS
  • 48. EXAMPLE OF FORWARD PASS 𝑓( ) = RECURRENT GRAPH NEURAL NETWORKS
  • 49. Inits SEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKS Move Nodes https://github.com/tkipf/gcn RECURRENT GRAPH NEURAL NETWORKS
  • 50. Inits SEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKS Move Nodes https://github.com/tkipf/gcn 𝒉 𝟎 (𝒍+𝟏) = 𝝈(෍ 𝒊∈𝝒 𝟏 𝒄𝒊,𝒍 𝒘 𝟏 (𝒍) 𝒉𝒋 (𝒍) ) RECURRENT GRAPH NEURAL NETWORKS
  • 51. F1RMSE PnL(%) Results: Graph Convolution 0.037 0.71 0.3 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 53. Recurrent Neural Networks Graph Convolution Networks 𝒘 𝟎 𝒘 𝟏 𝒉𝒊 𝒉 𝟎 (𝒍+𝟏) = 𝝈(𝒉 𝟎 (𝒍) 𝒘 𝟎 (𝒍) ෍ 𝒊∈𝝒 𝟏 𝒄𝒊,𝒍 𝒘𝒋 (𝒍) 𝒉𝒋 (𝒍) ) ቁ𝑓𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑓 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓 ቁ𝜄𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔𝜄 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄 ቁ𝑜𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑜 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜 ቁ𝜍𝑖 𝑙+1 𝑡 = 𝑡𝑎𝑛ℎ( 𝜔𝜍 𝑦𝑗 𝑙 + 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍
  • 54. Recurrent Neural Networks Graph Convolution Networks 𝒉 𝟎 (𝒍+𝟏) = 𝝈(𝒉 𝟎 (𝒍) 𝒘 𝟎 (𝒍) ෍ 𝒊∈𝝒 𝟏 𝒄𝒊,𝒍 𝒘𝒋 (𝒍) 𝒉𝒋 (𝒍) ) ቁ𝑓𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑓 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓 ቁ𝜄𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔𝜄 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄 ቁ𝑜𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑜 𝑦𝑗 𝑙 𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜 ቁ𝜍𝑖 𝑙+1 𝑡 = 𝑡𝑎𝑛ℎ( 𝜔𝜍 𝑦𝑗 𝑙 + 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍 ൱𝑓𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑓 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓 ൱𝜄𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔𝜄 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄 ൱𝑜𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑜 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜 ൱𝜍𝑖 𝑙+1 𝑡 = 𝑡𝑎𝑛ℎ( 𝜔𝜍 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 + 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍 Forget Gate Output Gate Input Gate Cell
  • 55. RECURRENT GRAPH CONVOLUTIONAL NETWORKS RECURRENT GRAPH NEURAL NETWORKS ൱𝑓𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑓 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 𝜍 𝑡−1 + 𝜓 𝑓ℎ 𝑡−1 + 𝑏𝑓 ൱𝜄𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔𝜄 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 𝜍 𝑡−1 + 𝜓𝜄ℎ 𝑡−1 + 𝑏𝜄 ൱𝑜𝑖 𝑙+1 𝑡 = 𝜎𝑔( 𝜔 𝑜 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 𝜍 𝑡−1 + 𝜓 𝑜ℎ 𝑡−1 + 𝑏 𝑜 ൱𝜍𝑖 𝑙+1 𝑡 = 𝑡𝑎𝑛ℎ( 𝜔𝜍 ෍ 𝑟∈ℛ ൱෍ 𝑗∈𝒩𝑖 𝑟 1 𝑐𝑖,𝑟 𝜃𝑟 𝑙 𝑦𝑗 𝑙 + 𝜃0 𝑙 𝑦𝑖 𝑙 + 𝜓𝜍ℎ 𝑡−1 + 𝑏𝜍 Forget Gate Output Gate Input Gate Cell ℎ 𝑡 ℎ 𝑡+1 ℎ 𝑡+2 ℎ 𝑡+3
  • 56. F1RMSE PnL(%) Results: Recurrent Graph Convolution 0.028 0.77 2.4 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 57. STRATEGY GRADIENT? 𝜕( 𝜃) 𝜕𝜃 − 𝜕( 𝜑) 𝜕𝜑 Returns Risk RECURRENT GRAPH NEURAL NETWORKS
  • 58. Graph Auto Encoders 𝑨 – input graph 𝒙 – input node ෡𝑨 – output graph Useful for predicting connectivity links RECURRENT GRAPH NEURAL NETWORKS
  • 60. 𝜎 μ Simulation TRADING STRATEGY GRADIENTS ෍ 𝑖=1 𝑛 𝜎𝑖 2 + 𝜇𝑖 2 − log 𝜎𝑖 − 1 | ො𝑦 − 𝑦| 2 2 Action: 𝒂 𝒕+𝟏 RECURRENT GRAPH NEURAL NETWORKS
  • 61. F1RMSE PnL(%) Results: Recurrent Graph Auto Encoder 0.024 0.86 5.6 Results for out of sample simulated trading Simple root mean square error F1-beta score (Harmonic mean of precision and recall) taken as classification decision where the predicted price is greater then the current price +15% transaction fee. Profits and losses (percentage) for out of sample trading. Assuming 15% transaction fee. RECURRENT GRAPH NEURAL NETWORKS
  • 62. Conclusions -Deep Learning works well on Euclidean data. -Attempts to utilize DL for Non-Euclidean are starting to become viable. -Reward shaping and drifted metrics are extremely misleading. -After trying heavily we conclude that Aggregated data (prices) of Ethereum is insufficient when trying to forecast behavior. -We introduce a novel layer: Recurrent Graph Convolution and demonstrate How this approach yield “tradable” results. RECURRENT GRAPH NEURAL NETWORKS
  • 63. FIN