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; Here is a question for philosophers and thread poets. Care to answer? There is inherent structure in the images and ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Oct 18, 2010, 7:23pm   #25
Joined Jan 2007
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

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?
fralo is offline   Reply With Quote
Old Oct 18, 2010, 7:49pm   #26
Joined Aug 2008
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?
Here are features from patches of weights in the second layer of a DBN trained with contrastive divergence and fine tuned with conjugate gradients. These features are high level representations of price patterns. Very powerful stuff. The only concern and not the least would be to devise an online version of the training process so that we can use them in trading. I am not aware that online learning exists for deep structures.

Sorry got to close a position...
Attached Thumbnails
feature-5-50.gif   feature-12-50.gif   feature-10012.gif  

Highfreq is offline   Reply With Quote
Old Oct 18, 2010, 9:47pm   #27
Joined Jan 2007
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

I found several bugs that were future leaks, and some that were due to stop and limit exit prices not correctly evaluated. I changed these to fix the bugs, and ran a strategy evaluation on the new code. The results are very different. e.g. For instantpip I get profit = -$1724 on 461 trades.

I did not test the other strategies, since I do not have confidence in my ability to code fixes in MatLab. The modified code is contained in the zip file below. You will find that there are changes in spotFX.m,hasline.m, indicatorBuilder.m, and the four exits. All of my future leak changes are marked by a comment beginning with scf, so they are easily found; however, to fix the problem with stop and limit exit prices I had to make larger changes, so not all those are commented. But they are obvious on comparison to earlier versions.

The code I used to train and evaluate the instantpip strategy is in the zip file. Anyone interested please do not take my word, but look at the code and find any errors that I have made. I hope you find some.

If you find no errors, then I suggest that most of the good results reported in TradeFX are due to future leaks and incorrect exit price evaluation. We must do the work over!
Attached Files
File Type: zip TradeFX mods.zip (10.7 KB, 165 views)
fralo is offline   Reply With Quote
Old Oct 19, 2010, 12:48am   #28
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
Here are features from patches of weights in the second layer of a DBN trained with contrastive divergence and fine tuned with conjugate gradients. These features are high level representations of price patterns. Very powerful stuff. The only concern and not the least would be to devise an online version of the training process so that we can use them in trading. I am not aware that online learning exists for deep structures.

Sorry got to close a position...
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
Krzysiaczek99 is offline   Reply With Quote
Old Oct 19, 2010, 3:25am   #29
Joined Jan 2007
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Quote:
Originally Posted by Highfreq View Post
Here are features from patches of weights in the second layer of a DBN trained with contrastive divergence and fine tuned with conjugate gradients. These features are high level representations of price patterns. Very powerful stuff. The only concern and not the least would be to devise an online version of the training process so that we can use them in trading. I am not aware that online learning exists for deep structures.

Sorry got to close a position...
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?
fralo is offline   Reply With Quote
Old Oct 19, 2010, 1:20pm   #30
Joined Jan 2009
Re: 3rd generation NN, deep learning, deep belief nets and Restricted Boltzmann Machi

Krzysiaczek99 started this thread
Quote:
Originally Posted by fralo View Post
I found several bugs that were future leaks, and some that were due to stop and limit exit prices not correctly evaluated. I changed these to fix the bugs, and ran a strategy evaluation on the new code. The results are very different. e.g. For instantpip I get profit = -$1724 on 461 trades.

I did not test the other strategies, since I do not have confidence in my ability to code fixes in MatLab. The modified code is contained in the zip file below. You will find that there are changes in spotFX.m,hasline.m, indicatorBuilder.m, and the four exits. All of my future leak changes are marked by a comment beginning with scf, so they are easily found; however, to fix the problem with stop and limit exit prices I had to make larger changes, so not all those are commented. But they are obvious on comparison to earlier versions.

The code I used to train and evaluate the instantpip strategy is in the zip file. Anyone interested please do not take my word, but look at the code and find any errors that I have made. I hope you find some.

If you find no errors, then I suggest that most of the good results reported in TradeFX are due to future leaks and incorrect exit price evaluation. We must do the work over!
After three small changes in the scripts (twice change open to close and transaction_fee set) accuracy seems to be 68.1% for instantPip strategy for EURUSD30_1_16Apr09.csv.

Missing funcionality in all those scripts seems to be spread handling. Spread must be considered both in profit calculation and entry/exit conditions calculation.

Krzysztof
Krzysiaczek99 is offline   Reply With Quote
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
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)