Neural-Net.cpp
// Number of training samples to average over
Number of training samples to average over
Number of training samples to average over
Network::Network( const std::vector< unsigned > &topology )
{
	unsigned numLayers = topology.size();
	for ( unsigned layerNumber = 0; layerNumber < numLayers; ++layerNumber ) 
	{
		m_layers.push_back( Layer() );
		std::cout << "Made a Layer!!" << std::endl;
		unsigned numOutputs = layerNumber == topology.size() - 1 ? 0 : topology[ layerNumber + 1 ];
		for (unsigned neuronNumber = 0; neuronNumber <= topology[ layerNumber ]; ++neuronNumber )
		{
			m_layers.back().push_back( Neuron( numOutputs, neuronNumber ) );
			std::cout << "Made a Neuron!!" << std::endl;
		}
		m_layers.back().back().setOutputValue( 1.0 );
	}
}
Network :: Network ( const std :: vector < unsigned > & topology ) { unsigned numLayers = topology . size ( ) ; for ( unsigned layerNumber = 0 ; layerNumber < numLayers ; ++ layerNumber ) { m_layers . push_back ( Layer ( ) ) ; std :: cout << " " << std :: endl ; unsigned numOutputs = layerNumber == topology . size ( ) - 1 ? 0 : topology [ layerNumber + 1 ] ; for ( unsigned neuronNumber = 0 ; neuronNumber <= topology [ layerNumber ] ; ++ neuronNumber ) { m_layers . back ( ) . push_back ( Neuron ( numOutputs , neuronNumber ) ) ; std :: cout << " " << std :: endl ; } m_layers . back ( ) . back ( ) . setOutputValue ( 1.0 ) ; } }
Number of training samples to average over
Number of training samples to average over
// if we're at the last layer, there's no outputs, // else the number of ouputs is the number of Neuron in the next layer // we have made a mew Layer, now fill it with neurons, and // add a bias neuron to the layer: // back, gives the last element in a container // Force the bias node's output value to 1.0. It's the last neuron created above