Encog Propogation Training Algorithms

Encog propogation training algorithms

Hello everybody,

today I want to describe in simple words some training algos of Encog.

Before I'll continue, I want to show general block schema of training algorithms:

Init NN can look like this:

public BasicNetwork CreateNetwork()
{
   var network = new BasicNetwork();
   network.AddLayer(new BasicLayer(WindowSize));
   network.AddLayer(new BasicLayer(10));
   network.AddLayer(new BasicLayer(1));
   network.Structure.FinalizeStructure();
   network.Reset();
   return network;
}

Steps "NN error < acceptable error" -> "Update weights according to learning algorithim" can look like this:

public void Train(BasicNetwork network, IMLDataSet training)
{
    ITrain train = new ResilientPropagation(network, training);
    int epoch = 1;
    do{
            train.Iteration();
            Console.WriteLine(@"Epoch #" + epoch + @" Error:" + train.Error);
            epoch++;
         } while (train.Error > acceptableError);
    }

The first in my decription goes Backpropogation algorithm. Few characteristics of it: 

1. probably the oldest training algorithm

2. As name says error are propogated back

3.  usage: 

var train = new Backpropogation(network, trainingSet, learningRate, momentum);

The next learning algorithm goes Manhattan update rule. Few characteristics of it:

1. use only sign of the gradient

2. Updates weiht by constant value ( depending from the sign it will be added or subtracted from the weithg )

3.  usage: 

var train = new ManhattanPropogation(network, trainingSet, constantValue);

as usually constantValue is very low ( around 0.00001 )

Other one is Quck propogation algorithm. Features of this method:

1. Newton's method of error minimization

2. Use learning trate which is higher value ( I used values starting from 2 )

3. Usage: 

var train = new QuickPropogation(network, trainingSet, learningRate);

Yet one more training algorithm is Resilent propogation algorithm. Some details of this method:

1. One of the fastest algorithm in Encog.

2. Easiest usage ( you don't care about rate, momentum or constant value )

3. It uses sign of gradient value.

4. It tries to compute delta value for each weight and use it for calculated weight.

5.  Example of usage:

var train = new ResilentPropogation(network, trainingSet);

6. It has four variants of resilent propogation: RPROP+, RPROP-, iRPROP+, iRPROP- . The best is considered iRPROP+

One more detail goes Scaled conjugate gradient. Features of it:

1. Use conjugate gradient method

2. Not applicable to all dataset

3. Doesn't require any learning paramethers

4. Example of usage:

var train = new ScaledConjugateGradient(network, trainingSet);

And the last one propogation algorithm is Levenberg Marquardt Algorithm ( aka LMA ). This is my favorite method. Features of it:

1. Something in between Gauss-Newton Algorithm ( GNA ) & Gradient Method

2. Easy to use ( no learning parameters )

3. Example of creating:

var train = new LevenbergMarquardtTraining(network, trainingSet);

4. Sometime it can be very efficient.

No Comments

Add a Comment

Transfer To New Acumatica Version

Transfer to new Acumatica version

Hello,

today I had task of switching to new version of Acumatica. From 4.2 to 5.1. 

The first surprise which I faced was lack of .Net framework 4.5.1. This shocked me especially from viewpoint that I had Visual Studio 2012 installed with service pack 4. Then I found that I need "Microsoft .NET Framework 4.5.1 Developer Pack for Windows Vista SP2, Windows 7 SP1, Windows 8, Windows 8.1, Windows Server 2008 SP2 Windows Server 2008 R2 SP1, Windows Server 2012 and Windows Server 2012 R2" .

No Comments

Add a Comment

T200 Acumatica Certificate

T200 Acumatica certificate

Hello everybody,

I want to boast that I finally received T200 Acumatica certificate!!!!!! And now I can proudly say that I'm certified Acumatica developer,

which gained

  • T100

  • T101

  • T200

  • T300

  • T900 certificates.

1 Comment

How To Get Tstamp In Acumatica

How to get tstamp in Acumatica

Hello everybody,

today I want to shre small note of how to generate timestamp for Acumatica objects ( in case if you use for some reason PXDataBase.Insert or  PXDataBase.Update)

PXDataBase has public method SelectTimeStamp.

public static byte[] SelectTimeStamp()
{
    return Provider.SelectTimeStamp();
}

So, in case if you need to put in variable t TimeStamp you can do the following:

var t = PXDatabase.SelectTimeStamp();

And variable t will have timestamp

No Comments

Add a Comment

Indiegogo

Indiegogo

I want to start campaign for making machine for my neural networks investigations. 

Here is the link if you want to participate

http://igg.me/p/neural-network-time-series-forecaster/x/10380153

No Comments

Add a Comment

Pxaccumulatorattribute In Acumatica

PXAccumulatorAttribute in Acumatica

Few notes about PXAccumulatorAttribute

  1. If to inherit from PXAccumulatorAttribute, you'll have access to member _SingleRecord. If to set in constructor to true, you'll configure single record update mode.
  2. There is PrepareInsert method. This method intended for updating policy for the data fields.
  3. PrepareInsert is invoked within Persist method, before Acumatica framework generates SQL commands for inserted data records.
  4. Among paramethers of PrepareInsert method there is PXAccumulatorCollection, which has method Update. In this method it's possible to configure fields which will be updated during PrepareInsert
  5. Method Update has following policies: PXDataFieldAssign.AssignBehavior.Initialize ( new value is inserted into the database column only if value is null ), PXDataFieldAssign.AssignBehavior.Replace ( new value replces old value ), PXDataFieldAssign.AssignBehavior.Summarize ( new value is added to the value stored in the database ), PXDataFieldAssign.AssignBehavior.Maximize ( maximum of the new value and the value from the database is saved in the database ), PXDataFieldAssign.AssignBehavior.Minimize ( minimum of the new value and the value form database is saved in the database )

So, in order to implement Accumulator attribute, following steps are needed:

1. Inherit class from PXAccumulatorAttribute

2. Implement PrepareInsert method

3. Implement PersistInserted method.

No Comments

Add a Comment

How To Disable Callback From Checkboxes In Acumatica

How to disable callback from Checkboxes in Acumatica.

Hello everybody.

Today I want to share some details about inner kitchen of Checkboxes in grid of Acumatica.

If to look inside of generated grid of Acumatica with FireFox Dom and style inspector, you can see following structure:

Item with checkbox is implemented as td, which has div, and has another div. The first level div has data for internal ( Acumatica presentation ),

and second div, or internal div has data for user display.

Once I had task to disable callback from checkbox. You may wonder why somebody can have such task. The reason each tick at checkbox made 

roundtrip to server, called number of delegates, which significantly slowed down perfomance. By the way,  CommitChanges="false" didn't work. 

I mean after setting CommitChanges="false" roundtrip still was made, which made life of client little bit more nervous.

So in order to fix CommitChanges="false" this I wrote the following javascript code:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
<script type="text/javascript">
  function checkDOMChange() {
    disableGridCheck();
    setTimeout(checkDOMChange, 100);
  }
  
  $(function () {
    checkDOMChange();
  }
   );
  
  function disableGridCheck() {
    $("[icon='GridUncheck']").on("click", function (elem) {
      $(this).attr("check", "1");
      $(this).attr("icon", "GridCheck");
      $($(this).children()[0]).attr("class", "control-icon-img control-GridCheck");
      return false;
    }
                                );
    $("[icon='GridCheck']").on("click", function (elem) {
      $(this).attr("check", "0");
      $(this).attr("icon", "GridUncheck");
      $($(this).children()[0]).attr("class", "control-icon-img control-GridUncheck");
      return false;
    }
                              );
  }
</script>

Few explanations about that code.

1. Function checkDOMChange is executed each 100 miliseconds, or 10 times per second. I don't know why, but jquery function document.read with junction with .on doesn't track newly created elements.

2.  $(function () { this code makes initial execution of tracking newly added elements at page.

3. Inside of code disableGridCheck we deal with two cases: when checkbox is changed. Due to fact, that checkbox implemented as td>div>div, I made code, which modifies two internal conditions.

No Comments

Add a Comment

Sources Of Trading Ideas

Sources of trading ideas

Hello everybody,

For now I read book "Quantitative Trading: How to Build Your Own Algorithmic Trading Business"

and would like to note sources of trading ideas, which mentioned there:

Type URL
Business schools’ finance professors’ web sites www.hbs.edu/research/research.html
 Social Science Research Network www.ssrn.com
 National Bureau of Economic Research www.nber.org
Business schools’ quantitative finance seminars www.ieor.columbia.edu/seminars/ financialengineering
Mark Hulbert’s column in theNew York Times’ Sunday business section www.nytimes.com
Buttonwood column in the Economist magazine’s finance section www.economist.com
 Yahoo! Finance finance.yahoo.com
 TradingMarkets www.TradingMarkets.com
 Seeking Alpha www.SeekingAlpha.com
 TheStreet.com www.TheStreet.com
 The Kirk Repor www.TheKirkReport.com
 Alea Blog www.aleablog.com
 Abnormal Returns www.AbnormalReturns.com
 Brett Steenbarger Trading Psychology www.brettsteenbarger.com
 Ernest Chan epchan.blogspot.com
 Elite Trader www.Elitetrader.com
 Wealth-Lab www.wealth-lab.com
 Stocks, Futures and Options magazine www.sfomag.com

For my surprise Ernest claims that it's possible to find interesting strategies, which can work after some modifications

No Comments

Add a Comment

How To Enable Disable Menu Item In Acumatica

How to enable disable menu item in Acumatica

Hello everybody,

Today I want to share short glimps how to Enable/Disable menu item. Let's some menu. For example it looks like this:

Suppose, we added menu action Activate in the following way:

public PXAction<EPEmployee> Activate;

[PXButton]
[PXUIField(DisplayName = "Activate")]
protected virtual IEnumerable activate(PXAdapter adapter)
{
   
}
// menu action was added like this:
public override void Initialize()
{
     Actions.AddMenuAction(Activate);
}

Let's say we want to disable menu item Activate. It can be achieved with usage of RowSelected event and SetEnabled function.  In my case I used the following construction:

protected virtual void EPEmployee_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
      Actions.SetEnabled("activate", false);//this code will disable menu item activate
}

Take note, that we declared PXAction, which is repsonsible for menu. Then in action Initialize ( this is code from extension class ) we added menu item. And then we can manipulate with enabling/disabling it through Actions.SetEnabled

2 Comments

  • arsiadi said

    Hi Yuriy, kindly need advice on what event handler of checkbox that must be define to enable/disable action menu. I have this custom "Verify" Action on CRCase screen that need to be enabled once the custom checkbox on FormView is checked.

    Please apologize for asking basic technique as I new to Acumatica framework.

    Thanks...

  • docotor said

    Hi Arsiadi, please describe little bit more your question. You have checkbox. If checkbox is selected, then some menu item should be enabled, and if checkbox is not checked, then menu item should be disabled. If that is the case, then enabling/disabling can be done in RowSelected event.

Add a Comment

Make Pxdefault As Not Required For Input

Make PXDefault as not required for input

Hello everybody,

Imagine following situation, you added to your DAC field some default value. For example like this:

[PXDBDate]
[PXDefault(typeof(AccessInfo.businessDate))]
public virtual DateTime? FromDate

And now you have default value as current date. But what, if you don't like to make it required for input. How to achieve this goal? The answer is quite simple, you just need to add PersistingCheck = PXPersistingCheck.Nothing into pxdefault attribute. Like this:

[PXDBDate]
[PXDefault(typeof(AccessInfo.businessDate), PersistingCheck = PXPersistingCheck.Nothing)]
public virtual DateTime? FromDate

With such changes you can init your values at form, and make it not required for input

No Comments

Add a Comment