FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Version 1.1

 
Post new topic   Reply to topic     Forum Index -> AND
View previous topic :: View next topic  
Author Message
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Sun Dec 17, 2006 3:50 pm    Post subject: Version 1.1 Reply with quote

Download: http://svn.dsource.org/projects/and/downloads/and-1.1.zip

Added

CostFunction
-Mean Squared Error
-Sum of Squares Error

ActicationFunction
-Tanh

NeuralNetwork
-Added support for momentum ( solution converges much more quickly! ).
-Progress callback ( with setProgressCallback ).
-Added Layer class, for supporting multiple hidden layers.


See test_xor.d for full usage.

Coming Next
Adaptive Learning!
QuickPropogation ( a faster variation on ClassicBackProp )
GA learning

And sometime in the future Self Organizing Maps.
Back to top
View user's profile Send private message MSN Messenger
.::]|DEAD|[::.Screamer



Joined: 06 Dec 2006
Posts: 10

PostPosted: Sun Mar 18, 2007 5:08 pm    Post subject: Reply with quote

I found same bugs in AND 1.2:
1. subfolder and1.2 in archive file (all files are in root folder too)
2. missing file util.d (module and.util)
3. in file mt.d (module mt) is `import tango.text.locale.Win32;`
Back to top
View user's profile Send private message
.::]|DEAD|[::.Screamer



Joined: 06 Dec 2006
Posts: 10

PostPosted: Sun Mar 18, 2007 5:24 pm    Post subject: Reply with quote

4. Linker notify me:
andd.lib(layer)
Error 42: Symbol Undefined _D6object6Object6toUtf8MFZAa
--- errorlevel 1


I linked with DM linker, compiler DMD and std lib phobos, there aren't method toUtf8 in class Object, only toString
Back to top
View user's profile Send private message
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Sun Mar 18, 2007 5:43 pm    Post subject: Reply with quote

And uses tango, found here http://dsource.org/projects/tango/wiki/Download , which is a replacement for phobos, I think it should compile with version=Phobos if you want to use phobos, Ill will check it.
Back to top
View user's profile Send private message MSN Messenger
.::]|DEAD|[::.Screamer



Joined: 06 Dec 2006
Posts: 10

PostPosted: Mon Mar 19, 2007 3:19 am    Post subject: Reply with quote

ok, thanks.
Back to top
View user's profile Send private message
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Mon Mar 19, 2007 10:49 am    Post subject: Reply with quote

Ok I have update AND to work with tango, I can build with phobos but getting all sorts of link errors - refering to iternal phobos things, ill keep looking at it.
Back to top
View user's profile Send private message MSN Messenger
heromyth



Joined: 26 Nov 2006
Posts: 46

PostPosted: Fri May 18, 2007 1:26 am    Post subject: Reply with quote

Here is a patch which makes AND 1.2 can be compiled with Phobos:

Code:

*** mt.d   Sat Feb 03 11:27:58 2007
--- mt.d   Fri May 18 09:48:00 2007
***************
*** 1,5 ****
  module mt;
! import tango.text.locale.Win32;
  /*
     A D-program ported by Derek Parnell 2006/04/12,
     based on the C-program for MT19937,  with initialization improved 2002/1/26,
--- 1,12 ----
  module mt;
!
! version ( Phobos )
! import std.date;
!
! version ( Tango )
! import tango.text.locale.Win32;
!
!
  /*
     A D-program ported by Derek Parnell 2006/04/12,
     based on the C-program for MT19937,  with initialization improved 2002/1/26,
***************
*** 68,77 ****
 
  /* initializes mt[] with a seed */
  void init_genrand(uint s, bool pAddEntropy = false)
! {
      mt[0]= (s + (pAddEntropy ? vLastRand + getUtcTime() + cast(uint)&init_genrand
                        : 0))
!             &  0xffffffffUL;
      for (mti=1; mti<mt.length; mti++)
      {
          mt[mti] = (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
--- 75,91 ----
 
  /* initializes mt[] with a seed */
  void init_genrand(uint s, bool pAddEntropy = false)
! {
! version ( Phobos )
!     mt[0]= (s + (pAddEntropy ? vLastRand + cast(uint)getUTCtime() + cast(uint)&init_genrand
!                       : 0))
!             &  0xffffffffUL;
!
! version ( Tango )
      mt[0]= (s + (pAddEntropy ? vLastRand + getUtcTime() + cast(uint)&init_genrand
                        : 0))
!             &  0xffffffffUL;
!
      for (mti=1; mti<mt.length; mti++)
      {
          mt[mti] = (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
*** platform.d   Sat Feb 03 11:27:28 2007
--- platform.d   Fri May 18 09:31:12 2007
***************
*** 9,19 ****
        import std.stream;
        import std.string;
        import std.conv;
      }
    version ( Tango )
      {
       
!       import tango.math.Core;
        import tango.io.Stdout;
        import tango.text.convert.Integer;
        import tango.text.Util;
--- 9,20 ----
        import std.stream;
        import std.string;
        import std.conv;
+      import std.utf;
      }
    version ( Tango )
      {
       
!       import tango.math.Math;
        import tango.io.Stdout;
        import tango.text.convert.Integer;
        import tango.text.Util;
*** test_xor.d   Sat Feb 03 11:32:16 2007
--- test_xor.d   Fri May 18 09:53:28 2007
***************
*** 8,20 ****
  const real [] [] inputs  = [
               [ 0,0 ],
               [ 0,1 ],
!              [ 1,0 ],
!              [ 1,1 ]            
 
  ];
 
 
! const real [] [] outputs = [
               [ 0 ],
               [ 1 ],
               [ 1 ],
--- 8,20 ----
  const real [] [] inputs  = [
               [ 0,0 ],
               [ 0,1 ],
!               [ 1,0 ],
!              [ 1,1 ]
 
  ];
 
 
! const real [] [] outputs = [
               [ 0 ],
               [ 1 ],
               [ 1 ],
***************
*** 25,31 ****
  void main ()
  {
 
!   try
      {
 
 
--- 25,31 ----
  void main ()
  {
 
!   try
      {
 
 
***************
*** 44,68 ****
        bp.learningRate = 0.1;
        bp.momentum = 0.5;
        bp.errorThreshold = 0.0001;
 
        void callback( uint currentEpoch, real currentError  )
     {
       Stdout.formatln("Epoch: [ {0} ] | Error [ {1} ] ",currentEpoch, currentError );
     }
 
        bp.setProgressCallback(&callback, 100 );
!       
        bp.train(inputs,outputs);
 
        Stdout.formatln("{0}",bp.actualEpochs);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[0])[0]);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[1])[0]);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[2])[0]);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[3])[0]);
      }
    catch ( Exception e )
      {
        Stdout.formatln("Exception: {0}",e.toUtf8() );
      }
 
  }
--- 44,99 ----
        bp.learningRate = 0.1;
        bp.momentum = 0.5;
        bp.errorThreshold = 0.0001;
+ version ( Phobos )
+ {
+       void callback( uint currentEpoch, real currentError  )
+    {
+      writefln("Epoch: [ %d ] | Error [ %f ] ",currentEpoch, currentError );
+    }
+ }
 
+ version ( Tango )
+ {
        void callback( uint currentEpoch, real currentError  )
     {
       Stdout.formatln("Epoch: [ {0} ] | Error [ {1} ] ",currentEpoch, currentError );
     }
+ }
 
        bp.setProgressCallback(&callback, 100 );
!
        bp.train(inputs,outputs);
 
+ version ( Phobos )
+ {
+       writefln("%d",bp.actualEpochs);
+       writefln("%f" ,bp.computeOutput(inputs[0])[0]);
+       writefln("%f" ,bp.computeOutput(inputs[1])[0]);
+       writefln("%f" ,bp.computeOutput(inputs[2])[0]);
+       writefln("%f" ,bp.computeOutput(inputs[3])[0]);
+ }
+
+ version ( Tango )
+ {
        Stdout.formatln("{0}",bp.actualEpochs);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[0])[0]);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[1])[0]);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[2])[0]);
        Stdout.formatln("{0}" ,bp.computeOutput(inputs[3])[0]);
+ }
+
+
      }
    catch ( Exception e )
      {
+ version ( Phobos )
+       writefln("Exception: %s", toUTF8(e.msg) );
+
+
+ version ( Tango )
        Stdout.formatln("Exception: {0}",e.toUtf8() );
+
+
      }
 
  }

Back to top
View user's profile Send private message
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Wed May 23, 2007 10:10 am    Post subject: Reply with quote

Thx!
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> AND All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group