3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machines

This is a discussion on 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machines within the Trading Software forums, part of the Commercial category; Originally Posted by Krzysiaczek99 So are you using this autoencoder setup with pretraining and fine tuning ? Did you or ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Oct 19, 2010, 5:57pm   #31
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by Krzysiaczek99 View Post
So are you using this autoencoder setup with pretraining and fine tuning ?

Did you or somebody else try Convolutional Neural Networks for market data ??

Krzysztof
Contrastive divergence as pretraining and conjugate gradients as fine tuning.

I also looked into convolutional nets with not much luck either. They seem to lend themselves to online updates better though. Here is some source code made public if you want to look into:
http://www.codeproject.com/KB/librar...cognition.aspx
http://www.inf.ufsc.br/~otuyama/eng/...cnn/index.html
Highfreq is offline   Reply With Quote
Old Oct 19, 2010, 6:00pm   #32
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by fralo View Post
I don't see why an online version could not be done. Conceptually you could do it with two Dll's, one to train and one to classify as follows:
Arrays/structures:
Rates array.. contains OHLCV for each bar
Target array..contains results if entry on a given bar
Input array
Net
MT4
Allocates memory for all structures (This is so that strategy tester will work. )
Maintains rates and Target array
Calls Net_Train with pointers to arrays
Calls Net_Classify with pointers to arrays
Uses result to trade
Net_Train
Calls feature_builder to build input array
Uses target array to label input array
Trains Net
Net_Classify
Calls feature_builder to update input array
Applies net to determine prediction
Feature_Builder
Calculates input to net .. indicators, conditions to build input array

Operation:
MT4 initializes the net by calling Net_Train
At end of each bar:
If a new label has been determined, MT4 calls Net_Train to update input array and retrain the net.
MT4 calls Net_Classify to get a prediction
MT4 makes appropriate trading decisions.

This all assumes that a net_train dll could run in 1 bar time. If not, then the training would have to go on in the background while new input was collected. Would require some double buffering.

Those are intriguing pictures of hidden structure. What is the nature of the input price patterns, and the DBN used to find them? I assume unsupervised learning for this level?
I fed the net with 2D image representations of the patterns. For the example below I used cycles that fit price well in the first part of the pattern but degrade in the second part. Next I attached a label to each of these patterns by looking for cycles that fit well the second part. These classes of patterns capture a switch of the cycle. To make the network happy I had to generate tons of surrogates from these patterns making sure there were no ambiguities between the classes. Below, I show 2 features from the net. See how the feature on the right has rotated clockwise. They indicate that price has switched to a larger time-frame. Now the remaining problem is not an implementation issue but I did not figure out yet how to make an online version for the training phase that would provide nicely evolving features.
Attached Images
  
Highfreq is offline   Reply With Quote
Old Oct 19, 2010, 9:48pm   #33
Joined Jan 2007
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by Highfreq View Post
I fed the net with 2D image representations of the patterns. For the example below I used cycles that fit price well in the first part of the pattern but degrade in the second part. Next I attached a label to each of these patterns by looking for cycles that fit well the second part. These classes of patterns capture a switch of the cycle. To make the network happy I had to generate tons of surrogates from these patterns making sure there were no ambiguities between the classes. Below, I show 2 features from the net. See how the feature on the right has rotated clockwise. They indicate that price has switched to a larger time-frame. Now the remaining problem is not an implementation issue but I did not figure out yet how to make an online version for the training phase that would provide nicely evolving features.
How much of the process required manual intervention?

What do you mean by cycles? There are so many discussions of cycles derived from FFT's, Goertzel, etc. but I think you mean something else.

How do you know when a network is happy? If you can distill that info, I'll buy a can or two. I still don't know when my wife is happy, and I've been married for many years.
fralo is offline   Reply With Quote
Old Oct 20, 2010, 2:37pm   #34
Joined Jan 2009
Some TradeFX results

Krzysiaczek99 started this thread Here is some TradeFX results obtained using attached EURUSD 1m file for instantPip strategy. I was changing the value of cutpoint variable between 2500 - 400.

For explanation: cutpoint 400 means 400 OOS bars and 400 training bars, cutpoint 1000 means 1000 OOS bars and 1000 training bars

cutpoint accuracy, total profit, number of trades

2500 62.7 0 0

2000 64.2 -0.8 54

1500 62.86 -82.7 276

1000 58.5 12.9 244

400 64 50.8 92

so intial conclusion is that for using SVM in predicting trade strategy results accuracy is quite high 58-64 %. It also shows that the prediction time horizon is quite short. As this strategy makes sell orders only more tests like this on different data sets must be done to avoid 'lucky' results.

Krzysztof
Attached Files
File Type: csv EURUSD1.csv (510.8 KB, 280 views)

Last edited by Krzysiaczek99; Oct 20, 2010 at 2:54pm.
Krzysiaczek99 is offline   Reply With Quote
Old Oct 20, 2010, 8:45pm   #35
Joined Jan 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

NNs of any kind are elaborate schemes for curve-fitting and nothing more than that.
intradaybill is offline   Reply With Quote
Old Oct 20, 2010, 10:52pm   #36
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by fralo View Post
How much of the process required manual intervention?

What do you mean by cycles? There are so many discussions of cycles derived from FFT's, Goertzel, etc. but I think you mean something else.

How do you know when a network is happy? If you can distill that info, I'll buy a can or two. I still don't know when my wife is happy, and I've been married for many years.
The cycle part is now automated. I use it in my trading. The cycles are from a third party package for Neuroshell. It's better than FFT in that it is data aware. Bandpass filters are computed from volatility itself.

Well, it will be wine for me. I am getting intimate with my nets. I figure they are happy when they make me happy. For sure DBNs need a lot of training samples before the features exhibit some structure. They settle very slowly...........
Highfreq is offline   Reply With Quote
Old Oct 20, 2010, 10:58pm   #37
Joined Aug 2008
Re: Some TradeFX results

Quote:
Originally Posted by Krzysiaczek99 View Post
Here is some TradeFX results obtained using attached EURUSD 1m file for instantPip strategy. I was changing the value of cutpoint variable between 2500 - 400.

For explanation: cutpoint 400 means 400 OOS bars and 400 training bars, cutpoint 1000 means 1000 OOS bars and 1000 training bars

cutpoint accuracy, total profit, number of trades

2500 62.7 0 0

2000 64.2 -0.8 54

1500 62.86 -82.7 276

1000 58.5 12.9 244

400 64 50.8 92

so intial conclusion is that for using SVM in predicting trade strategy results accuracy is quite high 58-64 %. It also shows that the prediction time horizon is quite short. As this strategy makes sell orders only more tests like this on different data sets must be done to avoid 'lucky' results.

Krzysztof
Interesting post! It would be interesting to see how your system behaves on ranging markets... My experience with SVMs is that they give similar results than NN-based classifiers. SVMs are good though because they are less prone to overfitting. That might partly explain your results.
Highfreq is offline   Reply With Quote
Old Oct 20, 2010, 11:00pm   #38
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by intradaybill View Post
NNs of any kind are elaborate schemes for curve-fitting and nothing more than that.
Let me quote StratOpt

There is absolutely nothing wrong with curve fitting. The only danger in optimizing is if you allow an overfit. Optimizing is only one part of a testing equation. In all reality, If you develop a strategy of any kind and it has a parameter or any other rule in which you make a choice as to what setting or rule to use then you have already curve fit before you begin any optimization. So yes you are curve fitting and yes genetic optimizers are a "fancy" way of doing such, and yes that is what they are designed to do. Again, there is nothing wrong with any of that. I have been very successfully incorporating such things into my development and testing and trading for quite a long while now and can't imagine not using them and remaining successful with any sort of programmatic strategy trading.

http://www.trade2win.com/boards/trad...ml#post1229142
Highfreq is offline   Reply With Quote
Old Oct 21, 2010, 1:16am   #39
Joined Jan 2009
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Krzysiaczek99 started this thread
Quote:
Originally Posted by Highfreq View Post
I fed the net with 2D image representations of the patterns. For the example below I used cycles that fit price well in the first part of the pattern but degrade in the second part. Next I attached a label to each of these patterns by looking for cycles that fit well the second part. These classes of patterns capture a switch of the cycle. To make the network happy I had to generate tons of surrogates from these patterns making sure there were no ambiguities between the classes. Below, I show 2 features from the net. See how the feature on the right has rotated clockwise. They indicate that price has switched to a larger time-frame. Now the remaining problem is not an implementation issue but I did not figure out yet how to make an online version for the training phase that would provide nicely evolving features.
So actually how do you model the time series ?? Using RBM ?? I think RBM was designed
for static picture recognition not dynamic time series. Or maybe you just feeding nets with static picture of the pattern ??? But in this case all info about dynamics of time series is lost.

Do you measure any error of recognition ?

Krzysztof
Krzysiaczek99 is offline   Reply With Quote
Old Oct 21, 2010, 3:55am   #40
 
DionysusToast's Avatar
Joined Dec 2009
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by fralo View Post
Here is a question for philosophers and thread poets. Care to answer?

There is inherent structure in the images and speech that have been the targets of most DBN research... most children can do better than most machines because they have learned the structure. The machines try to extract the structure. Some do it well for images and speech. Can they do it for markets?

Is there structure to some representation of the markets? Certainly not recognizable by most adults. Probably not recognizable by majority of traders. Do supertraders recognize structure, or are they just defying the odds?

DBN machines make sense for robotic applications. Do they make sense for the market?
No.

Let's say you have a bad knee. You can see a number of different types of specialist and depending on the area of specialisation, you will either have a muscle problem, bone problem or even immune system problem. Therapy will be physio, drugs or operation.

What you won't get much of is "this is not within my area of specialisation". After all, if the only tool you have is a hammer...

And so it comes to trading. Take someone with a background in statistics and they will probably use statistical models. Take someone with a background in programming and they will be writing strategies based on existing specifications (i.e. trading books). Take someone with a background in Neural Nets.....

So - this is more of the same. Attempting to use knowledge gained outside of trading within trading. Trying to apply your own comfort zone where you are not comfortable.

Ultimately - if you want to make money trading, you have to learn how to trade yourself. If you can't do that, you have zero chance of getting a computer to learn for you.
__________________
The proof of the pudding is whether there is actually any pudding in the first place.
DionysusToast is offline Software vendor   Reply With Quote
Old Oct 21, 2010, 8:10pm   #41
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by Krzysiaczek99 View Post
So actually how do you model the time series ?? Using RBM ?? I think RBM was designed
for static picture recognition not dynamic time series. Or maybe you just feeding nets with static picture of the pattern ??? But in this case all info about dynamics of time series is lost.

Do you measure any error of recognition ?

Krzysztof
Thatís my point. The net is a classifier and to make it dynamic it is trained on new bars. I am not aware of an efficient online training algorithm that would do that. It currently works but it is not practical mostly because it is very slow to converge.
Highfreq is offline   Reply With Quote
Old Oct 21, 2010, 8:12pm   #42
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by DionysusToast View Post
No.

Let's say you have a bad knee. You can see a number of different types of specialist and depending on the area of specialisation, you will either have a muscle problem, bone problem or even immune system problem. Therapy will be physio, drugs or operation.

What you won't get much of is "this is not within my area of specialisation". After all, if the only tool you have is a hammer...

And so it comes to trading. Take someone with a background in statistics and they will probably use statistical models. Take someone with a background in programming and they will be writing strategies based on existing specifications (i.e. trading books). Take someone with a background in Neural Nets.....

So - this is more of the same. Attempting to use knowledge gained outside of trading within trading. Trying to apply your own comfort zone where you are not comfortable.

Ultimately - if you want to make money trading, you have to learn how to trade yourself. If you can't do that, you have zero chance of getting a computer to learn for you.
Totally agree. But convene that there are useful tools out there. Hypothetical Joe the trader was doing very poorly the other day. Markets were so fuzzy until he realized that he did not have his glasses on. He is not an optometrist himself but he now knows that wearing glasses can really help in his case.
Highfreq is offline   Reply With Quote
Thanks! The following members like this post: DionysusToast
Old Oct 21, 2010, 9:59pm   #43
Joined Jan 2009
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Krzysiaczek99 started this thread
Quote:
Originally Posted by Highfreq View Post
Thatís my point. The net is a classifier and to make it dynamic it is trained on new bars. I am not aware of an efficient online training algorithm that would do that. It currently works but it is not practical mostly because it is very slow to converge.
Well, than perhaps you should read this Phd

"Composable, distributed-state models for high-dimensional time-series" from

http://www.cs.nyu.edu/~gwtaylor/

Here is a video lecture where Hinton refers to this paper and describes how it works



Implementation of this Phd is one of the goals of this thread - see 1st post.

So do you measure accuracy of your current prediction or pattern recognition somehow ??

Krzysztof
Krzysiaczek99 is offline   Reply With Quote
Old Oct 22, 2010, 7:15pm   #44
Joined Aug 2008
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by Krzysiaczek99 View Post
Well, than perhaps you should read this Phd

"Composable, distributed-state models for high-dimensional time-series" from

http://www.cs.nyu.edu/~gwtaylor/

Here is a video lecture where Hinton refers to this paper and describes how it works



Implementation of this Phd is one of the goals of this thread - see 1st post.

So do you measure accuracy of your current prediction or pattern recognition somehow ??

Krzysztof

I have experimented with the dynamic models from Graham. They are shallow nets though. They are not deep structures (2 layer dynamic CRBMs at most). So I have added layers which is allowed in theory but did not get any useful structure from the latent variables.

Accuracy wise? It depends. Detecting cycle shifts for example is close to 100% at completion. Usually I donít wait full completion. 60% completion gives me about 70% accuracy. The shift of cycles to a larger time-frame appears to not be ambiguous in most cases and it seems to not depend on the instrument either. But choosing the patterns randomly leads to accuracies no better than chance. A lot of care is required in selecting the data to train the net on. Itís a general rule about nets when applied to markets I think. The naÔve approach to feeding them with streaming market during training data does seem to work. I guess this is because there is no clear manifold to rely on.
Highfreq is offline   Reply With Quote
Old Oct 22, 2010, 8:28pm   #45
Joined Jan 2009
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Krzysiaczek99 started this thread
Quote:
Originally Posted by Highfreq View Post
I have experimented with the dynamic models from Graham. They are shallow nets though. They are not deep structures (2 layer dynamic CRBMs at most). So I have added layers which is allowed in theory but did not get any useful structure from the latent variables.

Accuracy wise? It depends. Detecting cycle shifts for example is close to 100% at completion. Usually I donít wait full completion. 60% completion gives me about 70% accuracy. The shift of cycles to a larger time-frame appears to not be ambiguous in most cases and it seems to not depend on the instrument either. But choosing the patterns randomly leads to accuracies no better than chance. A lot of care is required in selecting the data to train the net on. Itís a general rule about nets when applied to markets I think. The naÔve approach to feeding them with streaming market during training data does seem to work. I guess this is because there is no clear manifold to rely on.
Did you try FCRBM also ?? Any better luck ??

Quote:
A lot of care is required in selecting the data to train the net on. Itís a general rule about nets when applied to markets I think.
How to select the proper data for training ?? By knowing this we know which patterns will
occur in the future we are immediately the winner i think.

How do you convert output from you cycle indicator to binary values or probalilities
as it is required by RBM ?? maybe there is a possibility to improve.

Krzysztof
Krzysiaczek99 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Neural Networks - Genetic Algorithms - Boltzmann Machines - FOREX crystal balls? gtatix Forex 27 Apr 30, 2012 9:27am
How deep is your Level II? insight2 Technical Analysis 6 Apr 29, 2008 10:41pm
In at the deep end! superspur First Steps 12 Dec 24, 2007 11:34am
Deep insight Disqplay Trading Software 1 Feb 7, 2006 12:01am
Deep INsight NKE Trading Software 0 Apr 8, 2005 10:57am

LinkBacks (?)
LinkBack to this Thread: http://www.trade2win.com/boards/trading-software/105880-3rd-generation-nn-deep-learning-deep-belief-nets-restricted-boltzmann-machines.html
Posted By For Type Date
Better NN EA development - Page 82 - Forex-TSD This thread Pingback Oct 17, 2010 12:51pm

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)