From 673252f7eadc3aa0cfae3d826e1c7bbe2400df17 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 9 Jul 2012 13:57:37 -0600 Subject: It generates pngs just like the java version. Maybe even prettier. --- src/neuron.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/neuron.h') diff --git a/src/neuron.h b/src/neuron.h index dc30471..2ad5cfb 100644 --- a/src/neuron.h +++ b/src/neuron.h @@ -3,6 +3,9 @@ #include "neural/node.h" #include "neural/slope.h" +#include "neural/slopestd.h" + +#include namespace Neural { @@ -14,7 +17,7 @@ namespace Neural iInputs( 0 ), aWeights( 0 ), sBias( 0.0 ), - pSlope( 0 ) + pSlope( new Neural::SlopeStd() ) { } @@ -30,6 +33,21 @@ namespace Neural aWeights = new sigtype[iInputs]; } + virtual int setWeights( const sigtype *pWeights ) + { + for( int j = 0; j < iInputs; j++ ) + aWeights[j] = pWeights[j]; + + return iInputs; + } + + virtual int setBiases( const sigtype *pBiases ) + { + sBias = *pBiases; + + return 1; + } + virtual void process( sigtype *aInput, sigtype *aOutput ) { sigtype sOutput = sBias; -- cgit v1.2.3