Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 2.35
by jcl. 02/24/21 14:40
findContract not finding a contract
by strimp099. 02/24/21 07:33
Zorro - import diff time zones csv
by AndrewAMD. 02/23/21 17:52
Using stablecoin as CCY on binance
by marr. 02/23/21 03:08
dataNew broken?
by DdlV. 02/23/21 00:55
Stop and profit/loss targets
by jpslvie. 02/22/21 19:08
Higher for at least N days in a row
by strimp099. 02/22/21 07:53
general questions about multitasking
by faustf. 02/21/21 23:36
AUM Magazine
Latest Screens
Scheherazade's Journey
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Who's Online Now
6 registered members (Santofimio, AndrewAMD, dpn, Quad, Dooley, 1 invisible), 446 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LorraineJones, SkNiX, wongkrezi, Wolf19, traderlivy
18599 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: 3
London
T
TraderTom Online OP
Guest
TraderTom  Online OP
Guest
T

Joined: Jan 2021
Posts: 3
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,450
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,450
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: 3
London
T
TraderTom Online OP
Guest
TraderTom  Online OP
Guest
T

Joined: Jan 2021
Posts: 3
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: 21
Singapore
S
strimp099 Offline
Newbie
strimp099  Offline
Newbie
S

Joined: Jan 2021
Posts: 21
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: 3
London
T
TraderTom Online OP
Guest
TraderTom  Online OP
Guest
T

Joined: Jan 2021
Posts: 3
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