Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Has anyone used LSTM? #482248
01/16/21 22:41
01/16/21 22:41
Joined: Jan 2021
Posts: 18
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 18
London
Hi Everyone,

First time posting on here. I've been working on models for a couple of years, mostly with python, and have recently discovered zorro. The example machine learning scripts for zorro are very good but obviously written in R and C so a little alien to me.

I was wondering if anyone had done anything with LSTM's within zorro? Ideally within the example scripts to see a generic example. Obviously the main difference vs the standard keras example script is the shaping of the input data needs to be an array. Interested to see if anyones done anything with it?

Re: Has anyone used LSTM? [Re: TraderTom] #482307
01/27/21 09:22
01/27/21 09:22
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
An example LSTM structure:

Code
create_model <- function(batchSize) {
  dropout <- 0.3
  model <- keras_model_sequential() 
  model %>%
    layer_lstm(batch_input_shape =  c(batchSize, 1, 27), units = 128, return_sequences = TRUE, stateful = TRUE, dropout = dropout, recurrent_dropout = dropout) %>%
    layer_lstm(units = 64, return_sequences = TRUE, stateful = TRUE, dropout = dropout, recurrent_dropout = dropout) %>%
    layer_lstm(units = 8, return_sequences = FALSE, stateful = TRUE, dropout = dropout, recurrent_dropout = dropout) %>%
    layer_dense(units = 1, activation = 'sigmoid')
}

Re: Has anyone used LSTM? [Re: TraderTom] #482392
02/01/21 12:17
02/01/21 12:17
Joined: Jan 2021
Posts: 18
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 18
London
Thanks for your reply.

Sorry, it probably me being very very new to R but I'm struggling to understand how to use this in the context of zorro and R. I tried to create a model by modifying the DeepLearnKeras script as that seems to be the most obvious. It works fine in RStudio but then in zorro just fails at every step. Am I missing something in zorro to increase the verosity to give errors rather than just failing at each step?

Thanks

Tom

Re: Has anyone used LSTM? [Re: TraderTom] #482526
02/18/21 12:46
02/18/21 12:46
Joined: Jan 2021
Posts: 22
Singapore
S
strimp099 Offline
Newbie
strimp099  Offline
Newbie
S

Joined: Jan 2021
Posts: 22
Singapore
I’m also a python dev but the manual has enough to get started. Also note the R script has to have a certain structure for Zorro to know how to call. This might help: https://financial-hacker.com/build-better-strategies-part-5-developing-a-machine-learning-system/

Re: Has anyone used LSTM? [Re: TraderTom] #482536
02/20/21 00:28
02/20/21 00:28
Joined: Jan 2021
Posts: 18
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 18
London
This was more to do with data shaping and the way zorro sends data to the neural functions.

Its less about neural networks in R and more about data shaping into 3D inputs for LSTM's.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1