CvConvNet Class Reference

The class represents the convolutional neural network. More...

#include <cvconvnet.h>

Collaboration diagram for CvConvNet:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CvConvNet ()
 Constructor.
virtual ~CvConvNet ()
 Destructor.
double fprop (CvArr *input)
 Forward-propagation of input image through the whole network.
const CvMat * getplane (std::string id)
 Provides access to individual planes inside the network.
std::string toString ()
 Produces string representation of the convolutional net.
int fromString (std::string xml)
 Creates the convolutional net from a string representation.

Protected Attributes

std::vector< CvGenericPlane * > m_plane
 The container of the planes.
std::map< std::string, int > m_idmap
 Hash table mapping string ids into int ids.
std::string m_creator
 Name of creator of the network.
std::string m_name
 Name of the network itself.
std::string m_info
 Any additional info about the network.

Friends

std::ostream & operator<< (std::ostream &s, CvConvNet &n)
 Output of the network into stream.
std::istream & operator>> (std::istream &s, CvConvNet &n)
 [Not implemented yet]

Detailed Description

The class represents the convolutional neural network.

The class is a container of individual feature maps (called planes) of the convolutional neural network. The class also defines basic methods to operate with the network such as saving the network as an XML string, loading the network from a string, accessing values of individual planes inside hidden layers etc.

Examples:

testimg.cpp, and testmnist.cpp.

Definition at line 63 of file cvconvnet.h.


Constructor & Destructor Documentation

CvConvNet::CvConvNet (  ) 

Constructor.

Definition at line 59 of file cvconvnet.cpp.

References m_creator, m_info, and m_name.

CvConvNet::~CvConvNet (  )  [virtual]

Destructor.

Definition at line 66 of file cvconvnet.cpp.

References m_plane.


Member Function Documentation

double CvConvNet::fprop ( CvArr *  input  ) 

Forward-propagation of input image through the whole network.

The method propagates the input image through the whole network updating planes (feature maps) of each individual neuron. Each plane values can be accessed after fprop for further analysis.

Parameters:
input pointer to input image in CvMat or IplImage format
Returns:
(0,0) value of the last plane

Todo:
In case of wrong input, generate exception instead of printing to cerr

Todo:
implement parallel fprop() invocation since independent planes can execute fprop simultaneously!
Examples:
testimg.cpp, and testmnist.cpp.

Definition at line 87 of file cvconvnet.cpp.

References m_plane.

Referenced by main().

const CvMat * CvConvNet::getplane ( std::string  id  ) 

Provides access to individual planes inside the network.

The method returns a pointer to matrix of any individual feature map inside the network The plane is specified by its text id (it is the same id that is assigned to plane in XML file).

Parameters:
id String specifying the feature map to be accessed
Returns:
pointer to CvMat structure of the specified plane

Definition at line 119 of file cvconvnet.cpp.

References m_idmap, and m_plane.

std::string CvConvNet::toString (  ) 

Produces string representation of the convolutional net.

Method produces an XML representation of the complete structure of the convolutional network including information about connections between planes, weights for specific connections. The representation does NOT include current state of the network such as propagated values at each plane (feature map).

Returns:
string containing XML description of the network

Definition at line 134 of file cvconvnet.cpp.

int CvConvNet::fromString ( std::string  xml  ) 

Creates the convolutional net from a string representation.

The method creates Convolutional Net from its string XML representation

Parameters:
xml XML-string representing the network
Returns:
status of operation
Examples:
testimg.cpp, and testmnist.cpp.

Definition at line 146 of file cvconvnet.cpp.

References m_creator, m_idmap, m_info, m_name, m_plane, and parse().

Referenced by main().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
CvConvNet n 
) [friend]

Output of the network into stream.

Definition at line 152 of file cvconvnet.cpp.

std::istream& operator>> ( std::istream &  s,
CvConvNet n 
) [friend]

[Not implemented yet]

The operator is not implemented yet

Definition at line 166 of file cvconvnet.cpp.


Member Data Documentation

std::vector<CvGenericPlane *> CvConvNet::m_plane [protected]

The container of the planes.

Definition at line 92 of file cvconvnet.h.

Referenced by fprop(), fromString(), getplane(), operator<<(), and ~CvConvNet().

std::map<std::string, int> CvConvNet::m_idmap [protected]

Hash table mapping string ids into int ids.

Definition at line 95 of file cvconvnet.h.

Referenced by fromString(), and getplane().

std::string CvConvNet::m_creator [protected]

Name of creator of the network.

Definition at line 97 of file cvconvnet.h.

Referenced by CvConvNet(), fromString(), and operator<<().

std::string CvConvNet::m_name [protected]

Name of the network itself.

Definition at line 98 of file cvconvnet.h.

Referenced by CvConvNet(), fromString(), and operator<<().

std::string CvConvNet::m_info [protected]

Any additional info about the network.

Definition at line 99 of file cvconvnet.h.

Referenced by CvConvNet(), fromString(), and operator<<().


The documentation for this class was generated from the following files:
Generated on Fri Aug 3 16:17:31 2007 for ConvNet by  doxygen 1.5.0