|
NeuroTIC 0.0
|
Construction Functions.
http://tituxdev.github.io/NeuroTIC/src/CPU/ntbuilder.c.
More...


Go to the source code of this file.
Macros | |
| #define | NEWNET(network, neurons) newnet( &network, neurons, (layer_t)sizeof( neurons )/sizeof( uint16_t ) ) |
| Convenience macro to create a new network. | |
| #define | CREATE_NET_FEEDFORWARD(network, i, neurons) |
| Convenience macro to create and build a feedforward network. | |
Functions | |
| struct net_s * | newnet (net_s *net, uint16_t *neurons_per_layer, layer_t layers_size) |
| Initializes a new neural network structure. | |
| struct net_s * | buildnet (net_s *net) |
| Builds the internal buffers and connections of a neural network. | |
Construction Functions.
http://tituxdev.github.io/NeuroTIC/src/CPU/ntbuilder.c.
Provides memory allocation and pointer setup for neurons, input/output references, and inter-layer buffers.
Uses memtrack() to manage memory safely.
Definition in file ntbuilder.h.
| #define CREATE_NET_FEEDFORWARD | ( | network, | |
| i, | |||
| neurons | |||
| ) |
Convenience macro to create and build a feedforward network.
Combines newnet() and buildnet() into a single step for creating a feedforward network with the specified input size and layer configuration.
| network | Name of the network variable to create. |
| i | Number of external inputs to the network. |
| neurons | Array defining the number of neurons in each layer. |
| #define NEWNET | ( | network, | |
| neurons | |||
| ) | newnet( &network, neurons, (layer_t)sizeof( neurons )/sizeof( uint16_t ) ) |
Convenience macro to create a new network.
Simplifies calling newnet() by automatically calculating the number of layers from the neurons array size.
| network | Pointer to the network structure to initialize. |
| neurons | Array defining the number of neurons per layer. |
Builds the internal buffers and connections of a neural network.
| net | Pointer to the network structure to build. |
Allocates memory for inputs, outputs, and inter-layer buffers according to the bff_wiring configuration.
Sets neuron input pointers and weight arrays.
Buffer type explanations:
src_type.Validates wiring configurations and ensures all pointers are correctly set up for feedforward computation. Uses memtrack for all allocations.
References wiring_s::array_type, wiring_s::arrays, net_s::bff, neuron_s::bff_idx, neuron_s::in, net_s::in, neuron_s::inputs, net_s::inputs, net_s::layers, net_s::neurons, net_s::nn, neuron_s::out, net_s::out, wiring_s::size, wiring_s::src_index, wiring_s::src_layer, wiring_s::src_type, and net_s::wiring.
Referenced by loadnet().
Initializes a new neural network structure.
| net | Pointer to the network structure to initialize. |
| neurons_per_layer | Array specifying the number of neurons in each layer. |
| layers_size | Number of layers (size of neurons_per_layer array). |
Initializes a new neural network structure by allocating memory for neurons and layers, and setting initial pointers to NULL.
Validates input parameters and uses memtrack to register allocations for automatic cleanup.
References net_s::layers, and net_s::neurons.
Referenced by loadnet().