panann
|
#include <MultiLayerNeuralTopology.h>
Classes | |
struct | InputConnection |
struct | Layer |
struct | OutputConnection |
Public Member Functions | |
MultiLayerNeuralTopology (const MultiLayerNeuralTopology &)=delete | |
MultiLayerNeuralTopology & | operator= (const MultiLayerNeuralTopology &)=delete |
void | AddHiddenLayer (size_t neuron_count) |
void | EnableShortcutConnections () |
void | DisableShortcutConnections () |
void | ConstructTopology () |
bool | IsTopologyConstructed () const |
size_t | GetHiddenLayerCount () const |
const Layer & | GetHiddenLayer (size_t layer_index) const |
size_t | GetInputConnectionCount () const |
size_t | GetOutputConnectionCount () const |
const InputConnection & | GetInputConnection (size_t index) const |
const OutputConnection & | GetOutputConnection (size_t index) const |
![]() | |
NeuronContainer (const NeuronContainer &)=delete | |
NeuronContainer & | operator= (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 Neuron & | GetNeuron (size_t neuron_index) const |
Protected Member Functions | |
Layer & | GetHiddenLayer (size_t layer_index) |
InputConnection & | GetInputConnection (size_t index) |
OutputConnection & | GetOutputConnection (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) |
![]() | |
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) |
Neuron & | GetNeuron (size_t neuron_index) |
Neuron & | GetInputNeuron (size_t input_neuron_index) |
Neuron & | GetOutputNeuron (size_t output_neuron_index) |
Neuron & | GetBiasNeuron (size_t bias_neuron_index) |
Neuron & | GetHiddenNeuron (size_t hidden_neuron_index) |
const Neuron & | GetOutputNeuron (size_t output_neuron_index) const |
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.
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.
|
protected |
Assign the next |count| input connections and return the index at which these connections begin.
|
protected |
Assign the next |count| output connections and return the index at which these connections begin.
|
protected |
Allocate storage for all the connections this topology will require.
|
protected |
Indicates if the connections for the topology have been allocated.
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.
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
|
protectedvirtual |
Set the input and output connection indices assigned to each neuron into the neurons themselves.
Reimplemented in panann::RecurrentNeuralNetwork.
|
protected |
Get a writable view of the hidden layer at |layer_index|.
const MultiLayerNeuralTopology::Layer & panann::MultiLayerNeuralTopology::GetHiddenLayer | ( | size_t | layer_index | ) | const |
Get a read-only view of the hidden layer at |layer_index|.
size_t panann::MultiLayerNeuralTopology::GetHiddenLayerCount | ( | ) | const |
Get the count of hidden layers in the topology.
|
protected |
Get a writable view of a single input connection at |index| in the |input_connections_| vector.
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.
size_t panann::MultiLayerNeuralTopology::GetInputConnectionCount | ( | ) | const |
Get the count of all input connections in the network topology.
|
protected |
Get a writable view of a single output connection at |index| in the |output_connections_| vector.
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.
size_t panann::MultiLayerNeuralTopology::GetOutputConnectionCount | ( | ) | const |
Get the count of all output connections in the network topology.
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.