diff options
author | Mike Buland <mike@xagasoft.com> | 2012-07-09 13:57:37 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2012-07-09 13:57:37 -0600 |
commit | 673252f7eadc3aa0cfae3d826e1c7bbe2400df17 (patch) | |
tree | fdb3a7f602ca9d91794f35e880017756d8487fa9 /src/container.h | |
parent | 87dc10690035b02485067f2b0b77bcb0459da42b (diff) | |
download | libneural-673252f7eadc3aa0cfae3d826e1c7bbe2400df17.tar.gz libneural-673252f7eadc3aa0cfae3d826e1c7bbe2400df17.tar.bz2 libneural-673252f7eadc3aa0cfae3d826e1c7bbe2400df17.tar.xz libneural-673252f7eadc3aa0cfae3d826e1c7bbe2400df17.zip |
It generates pngs just like the java version.
Maybe even prettier.
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 ); |