# HG changeset patch # User revcompgeek # Date 1208291989 21600 # Node ID 810d58835f86aa54885acba177c2bd09505273eb # Parent 73beed4844556df9e7657e5dab75bb8abc78dbc9 Added momentum and stochastic training to backprop. diff -r 73beed484455 -r 810d58835f86 trunk/aid/misc.d --- a/trunk/aid/misc.d Sat Apr 12 21:55:37 2008 -0600 +++ b/trunk/aid/misc.d Tue Apr 15 14:39:49 2008 -0600 @@ -1,6 +1,7 @@ module aid.misc; import std.random; +import std.stdio; class InputException : Exception { this(char[] message){ @@ -10,4 +11,28 @@ double rnd(){ // The function that should be included in every math library! return (cast(double)rand())/uint.max; +} + +void printArray(double[] array){ + writef("["); + for(int i=0; i