panann
Classes | Public Member Functions | Protected Member Functions | List of all members
panann::MultiLayerNeuralTopology Class Reference

#include <MultiLayerNeuralTopology.h>

Inheritance diagram for panann::MultiLayerNeuralTopology:
Inheritance graph
[legend]
Collaboration diagram for panann::MultiLayerNeuralTopology:
Collaboration graph
[legend]

Classes

struct  InputConnection
 
struct  Layer
 
struct  OutputConnection
 

Public Member Functions

 MultiLayerNeuralTopology (const MultiLayerNeuralTopology &)=delete
 
MultiLayerNeuralTopologyoperator= (const MultiLayerNeuralTopology &)=delete
 
void AddHiddenLayer (size_t neuron_count)
 
void EnableShortcutConnections ()
 
void DisableShortcutConnections ()
 
void ConstructTopology ()
 
bool IsTopologyConstructed () const
 
size_t GetHiddenLayerCount () const
 
const LayerGetHiddenLayer (size_t layer_index) const
 
size_t GetInputConnectionCount () const
 
size_t GetOutputConnectionCount () const
 
const InputConnectionGetInputConnection (size_t index) const
 
const OutputConnectionGetOutputConnection (size_t index) const
 
- Public Member Functions inherited from panann::NeuronContainer
 NeuronContainer (const NeuronContainer &)=delete
 
NeuronContaineroperator= (const NeuronContainer &)=delete
 
void SetInputNeuronCount (size_t input_neuron_count)
 
size_t GetInputNeuronCount () const
 
void SetOutputNeuronCount (size_t output_neuron_count)
 
size_t GetOutputNeuronCount () const
 
size_t GetNeuronCount () const
 
const NeuronGetNeuron (size_t neuron_index) const
 

Protected Member Functions

LayerGetHiddenLayer (size_t layer_index)
 
InputConnectionGetInputConnection (size_t index)
 
OutputConnectionGetOutputConnection (size_t index)
 
size_t AddInputConnections (size_t count)
 
size_t AddOutputConnections (size_t count)
 
virtual void FixNeuronConnectionIndices ()
 
void AllocateConnections ()
 
bool AreConnectionsAllocated () const
 
virtual void ConnectFully ()
 
void ConnectLayerToNeuron (size_t from_neuron_index, size_t from_neuron_count, size_t to_neuron_index)
 
void ConnectLayers (size_t from_neuron_index, size_t from_neuron_count, size_t to_neuron_index, size_t to_neuron_count)
 
void ConnectBiasNeuron (size_t bias_neuron_index, size_t to_neuron_index, size_t to_neuron_count)
 
void ConnectNeurons (size_t from_neuron_index, size_t to_neuron_index)
 
- Protected Member Functions inherited from panann::NeuronContainer
size_t GetHiddenNeuronStartIndex () const
 
size_t GetInputNeuronStartIndex () const
 
size_t GetOutputNeuronStartIndex () const
 
size_t GetBiasNeuronStartIndex () const
 
size_t GetHiddenNeuronCount () const
 
size_t GetBiasNeuronCount () const
 
size_t AddHiddenNeurons (size_t count)
 
void AddBiasNeurons (size_t count)
 
void AllocateNeurons ()
 
bool AreNeuronsAllocated () const
 
void SetNeuronActivationFunction (size_t neuron_index, ActivationFunctionType type)
 
NeuronGetNeuron (size_t neuron_index)
 
NeuronGetInputNeuron (size_t input_neuron_index)
 
NeuronGetOutputNeuron (size_t output_neuron_index)
 
NeuronGetBiasNeuron (size_t bias_neuron_index)
 
NeuronGetHiddenNeuron (size_t hidden_neuron_index)
 
const NeuronGetOutputNeuron (size_t output_neuron_index) const
 

Detailed Description

Supports building multi-layer topologies made up of neurons.
This class is intended only to facilitate building the structure of networks built from neurons and organized into layers.
To that end, it knows how to allocate and assign connections between all the neurons in each layer.

Primarily useful to group hidden neurons into layers and track input and output connections to and from each neuron in the topology.

Member Function Documentation

◆ AddHiddenLayer()

void panann::MultiLayerNeuralTopology::AddHiddenLayer ( size_t  neuron_count)

Append a hidden layer to the end of the list of existing hidden layers.
Hidden layers are located after the input layer and before the output layer.
Once added, hidden layers may not be removed.
Hidden layers may not be added after the network topology has been constructed.

◆ AddInputConnections()

size_t panann::MultiLayerNeuralTopology::AddInputConnections ( size_t  count)
protected

Assign the next |count| input connections and return the index at which these connections begin.

◆ AddOutputConnections()

size_t panann::MultiLayerNeuralTopology::AddOutputConnections ( size_t  count)
protected

Assign the next |count| output connections and return the index at which these connections begin.

◆ AllocateConnections()

void panann::MultiLayerNeuralTopology::AllocateConnections ( )
protected

Allocate storage for all the connections this topology will require.

◆ AreConnectionsAllocated()

bool panann::MultiLayerNeuralTopology::AreConnectionsAllocated ( ) const
protected

Indicates if the connections for the topology have been allocated.

◆ ConstructTopology()

void panann::MultiLayerNeuralTopology::ConstructTopology ( )

Build the network topology.
After construction, the number of input and output neurons, number of hidden layers, use of shortcut connections, and some other settings may not be modified.

◆ EnableShortcutConnections()

void panann::MultiLayerNeuralTopology::EnableShortcutConnections ( )

Shortcut connections are feed-forward connections between two non-adjacent layers.
Note: Changing this setting after the network topology has been constructed will have no impact on the network topology.
Default: disabled

◆ FixNeuronConnectionIndices()

void panann::MultiLayerNeuralTopology::FixNeuronConnectionIndices ( )
protectedvirtual

Set the input and output connection indices assigned to each neuron into the neurons themselves.

Reimplemented in panann::RecurrentNeuralNetwork.

◆ GetHiddenLayer() [1/2]

MultiLayerNeuralTopology::Layer & panann::MultiLayerNeuralTopology::GetHiddenLayer ( size_t  layer_index)
protected

Get a writable view of the hidden layer at |layer_index|.

◆ GetHiddenLayer() [2/2]

const MultiLayerNeuralTopology::Layer & panann::MultiLayerNeuralTopology::GetHiddenLayer ( size_t  layer_index) const

Get a read-only view of the hidden layer at |layer_index|.

◆ GetHiddenLayerCount()

size_t panann::MultiLayerNeuralTopology::GetHiddenLayerCount ( ) const

Get the count of hidden layers in the topology.

◆ GetInputConnection() [1/2]

MultiLayerNeuralTopology::InputConnection & panann::MultiLayerNeuralTopology::GetInputConnection ( size_t  index)
protected

Get a writable view of a single input connection at |index| in the |input_connections_| vector.

◆ GetInputConnection() [2/2]

const MultiLayerNeuralTopology::InputConnection & panann::MultiLayerNeuralTopology::GetInputConnection ( size_t  index) const

Get a read-only view of a single input connection at |index|. Note: Connections must be allocated prior to calling this.

◆ GetInputConnectionCount()

size_t panann::MultiLayerNeuralTopology::GetInputConnectionCount ( ) const

Get the count of all input connections in the network topology.

◆ GetOutputConnection() [1/2]

MultiLayerNeuralTopology::OutputConnection & panann::MultiLayerNeuralTopology::GetOutputConnection ( size_t  index)
protected

Get a writable view of a single output connection at |index| in the |output_connections_| vector.

◆ GetOutputConnection() [2/2]

const MultiLayerNeuralTopology::OutputConnection & panann::MultiLayerNeuralTopology::GetOutputConnection ( size_t  index) const

Get a read-only view of a single output connection at |index|. Note: Connections must be allocated prior to calling this.

◆ GetOutputConnectionCount()

size_t panann::MultiLayerNeuralTopology::GetOutputConnectionCount ( ) const

Get the count of all output connections in the network topology.

◆ IsTopologyConstructed()

bool panann::MultiLayerNeuralTopology::IsTopologyConstructed ( ) const

Returns true if the network topology has been constructed and false otherwise.
Note: Once constructed, the network topology is fixed and cannot be changed.


The documentation for this class was generated from the following files: