summaryrefslogtreecommitdiff
path: root/src/neuron.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/neuron.h')
-rw-r--r--src/neuron.h20
1 files changed, 19 insertions, 1 deletions
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 @@
3 3
4#include "neural/node.h" 4#include "neural/node.h"
5#include "neural/slope.h" 5#include "neural/slope.h"
6#include "neural/slopestd.h"
7
8#include <bu/sio.h>
6 9
7namespace Neural 10namespace Neural
8{ 11{
@@ -14,7 +17,7 @@ namespace Neural
14 iInputs( 0 ), 17 iInputs( 0 ),
15 aWeights( 0 ), 18 aWeights( 0 ),
16 sBias( 0.0 ), 19 sBias( 0.0 ),
17 pSlope( 0 ) 20 pSlope( new Neural::SlopeStd<sigtype>() )
18 { 21 {
19 } 22 }
20 23
@@ -30,6 +33,21 @@ namespace Neural
30 aWeights = new sigtype[iInputs]; 33 aWeights = new sigtype[iInputs];
31 } 34 }
32 35
36 virtual int setWeights( const sigtype *pWeights )
37 {
38 for( int j = 0; j < iInputs; j++ )
39 aWeights[j] = pWeights[j];
40
41 return iInputs;
42 }
43
44 virtual int setBiases( const sigtype *pBiases )
45 {
46 sBias = *pBiases;
47
48 return 1;
49 }
50
33 virtual void process( sigtype *aInput, sigtype *aOutput ) 51 virtual void process( sigtype *aInput, sigtype *aOutput )
34 { 52 {
35 sigtype sOutput = sBias; 53 sigtype sOutput = sBias;