diff options
Diffstat (limited to 'src/container.h')
-rw-r--r-- | src/container.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/container.h b/src/container.h index d9eeffd..f341bf8 100644 --- a/src/container.h +++ b/src/container.h | |||
@@ -22,6 +22,30 @@ namespace Neural | |||
22 | delete *i; | 22 | delete *i; |
23 | } | 23 | } |
24 | 24 | ||
25 | virtual int setWeights( const sigtype *pWeights ) | ||
26 | { | ||
27 | int iOffset = 0; | ||
28 | for( typename Container<sigtype>::NodeList::iterator i = | ||
29 | Container<sigtype>::getNodeList().begin(); i; i++ ) | ||
30 | { | ||
31 | iOffset += (*i)->setWeights( &pWeights[iOffset] ); | ||
32 | } | ||
33 | |||
34 | return iOffset; | ||
35 | } | ||
36 | |||
37 | virtual int setBiases( const sigtype *pBiases ) | ||
38 | { | ||
39 | int iOffset = 0; | ||
40 | for( typename Container<sigtype>::NodeList::iterator i = | ||
41 | Container<sigtype>::getNodeList().begin(); i; i++ ) | ||
42 | { | ||
43 | iOffset += (*i)->setBiases( &pBiases[iOffset] ); | ||
44 | } | ||
45 | |||
46 | return iOffset; | ||
47 | } | ||
48 | |||
25 | virtual void addNode( Node<sigtype> *pNode ) | 49 | virtual void addNode( Node<sigtype> *pNode ) |
26 | { | 50 | { |
27 | lNodes.append( pNode ); | 51 | lNodes.append( pNode ); |