View previous topic :: View next topic |
Author |
Message |
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Sun Dec 17, 2006 3:50 pm Post subject: Version 1.1 |
|
|
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 |
|
|
.::]|DEAD|[::.Screamer
Joined: 06 Dec 2006 Posts: 10
|
Posted: Sun Mar 18, 2007 5:08 pm Post subject: |
|
|
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 |
|
|
.::]|DEAD|[::.Screamer
Joined: 06 Dec 2006 Posts: 10
|
Posted: Sun Mar 18, 2007 5:24 pm Post subject: |
|
|
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 |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Sun Mar 18, 2007 5:43 pm Post subject: |
|
|
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 |
|
|
.::]|DEAD|[::.Screamer
Joined: 06 Dec 2006 Posts: 10
|
Posted: Mon Mar 19, 2007 3:19 am Post subject: |
|
|
ok, thanks. |
|
Back to top |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Mon Mar 19, 2007 10:49 am Post subject: |
|
|
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 |
|
|
heromyth
Joined: 26 Nov 2006 Posts: 46
|
Posted: Fri May 18, 2007 1:26 am Post subject: |
|
|
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 |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Wed May 23, 2007 10:10 am Post subject: |
|
|
Thx! |
|
Back to top |
|
|
|
|
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
|