SlideShare a Scribd company logo
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
Learning Graphs Representations Using Recurrent Graph Convolution Networks For Forecasting Ethereum Prices
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
Learning Graphs Representations Using Recurrent Graph Convolution Networks For Forecasting Ethereum Prices
<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

More Related Content

PDF
TensorFlow and Deep Learning Tips and Tricks
PDF
safe and efficient off policy reinforcement learning
PDF
ゆるふわ強化学習入門
PDF
La question de la durabilité des technologies de calcul et de télécommunication
PDF
Dueling network architectures for deep reinforcement learning
PDF
Reinforcement Learning - DQN
PPTX
PPT - Adaptive Quantitative Trading : An Imitative Deep Reinforcement Learnin...
PPTX
PPT - Enhancing the Locality and Breaking the Memory Bottleneck of Transforme...
TensorFlow and Deep Learning Tips and Tricks
safe and efficient off policy reinforcement learning
ゆるふわ強化学習入門
La question de la durabilité des technologies de calcul et de télécommunication
Dueling network architectures for deep reinforcement learning
Reinforcement Learning - DQN
PPT - Adaptive Quantitative Trading : An Imitative Deep Reinforcement Learnin...
PPT - Enhancing the Locality and Breaking the Memory Bottleneck of Transforme...

What's hot (20)

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

Similar to Learning Graphs Representations Using Recurrent Graph Convolution Networks For Forecasting Ethereum Prices (20)

PPTX
Batch normalization presentation
PPTX
pptx - Psuedo Random Generator for Halfspaces
PPTX
pptx - Psuedo Random Generator for Halfspaces
PPTX
All projects
PDF
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
PDF
Lesson_8_DeepLearning.pdf
PPTX
2021 06-02-tabnet
PDF
Network predictive analysis
PDF
Josh Patterson MLconf slides
PPTX
Deep Learning with Apache MXNet (September 2017)
PDF
Big data 2.0, deep learning and financial Usecases
PDF
International Journal on Cryptography and Information Security (IJCIS)
PDF
Introduction to Tensor Flow for Optical Character Recognition (OCR)
PDF
Machine Learning Notes for beginners ,Step by step
PDF
Machine learning
PPTX
Artificial neural networks introduction
PPTX
Introduction to deep learning
PDF
Restricting the Flow: Information Bottlenecks for Attribution
PDF
Safety Verification of Deep Neural Networks_.pdf
PDF
Intel Nervana Artificial Intelligence Meetup 1/31/17
Batch normalization presentation
pptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
All projects
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
Lesson_8_DeepLearning.pdf
2021 06-02-tabnet
Network predictive analysis
Josh Patterson MLconf slides
Deep Learning with Apache MXNet (September 2017)
Big data 2.0, deep learning and financial Usecases
International Journal on Cryptography and Information Security (IJCIS)
Introduction to Tensor Flow for Optical Character Recognition (OCR)
Machine Learning Notes for beginners ,Step by step
Machine learning
Artificial neural networks introduction
Introduction to deep learning
Restricting the Flow: Information Bottlenecks for Attribution
Safety Verification of Deep Neural Networks_.pdf
Intel Nervana Artificial Intelligence Meetup 1/31/17
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Big Data Technologies - Introduction.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
Big Data Technologies - Introduction.pptx
cuic standard and advanced reporting.pdf
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology

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
  • 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
  • 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