ML functions
 
Loading...
Searching...
No Matches
NNBuilder Class Reference

Implements a neural network builder for constructing and registering neural network layers. More...

#include <NNBuilder.h>

Public Member Functions

 NNBuilder ()
 Default constructor for NNBuilder.
 
 NNBuilder (std::string weightsFile, std::string biasFile)
 Constructor for NNBuilder with weights and bias files.
 
 ~NNBuilder ()
 Destructor for NNBuilder.
 
std::string build ()
 Builds and returns the computation string representing the neural network.
 
NNBuilderdenseLayer (int units, int input_size, float *weights, float *bias, Activation ac)
 Adds a dense layer to the neural network.
 
NNBuilderdenseLayer (int units, int input_size, Activation ac)
 Adds a dense layer to the neural network using weights and biases from files.
 
NNBuilderconvLayer (int num_filters, int *dims, float *weights, float *bias, Activation ac)
 Adds a convolutional layer to the neural network.
 
NNBuildermaxPoolLayer (int side, int height, int width)
 Adds a max pooling layer to the neural network.
 

Detailed Description

Implements a neural network builder for constructing and registering neural network layers.

Constructor & Destructor Documentation

◆ NNBuilder()

NNBuilder::NNBuilder ( std::string weightsFile,
std::string biasFile )
inline

Constructor for NNBuilder with weights and bias files.

Parameters
weightsFilePath to the file containing weights.
biasFilePath to the file containing biases.

Member Function Documentation

◆ build()

std::string NNBuilder::build ( )
inline

Builds and returns the computation string representing the neural network.

Returns
The computation string.

◆ convLayer()

NNBuilder & NNBuilder::convLayer ( int num_filters,
int * dims,
float * weights,
float * bias,
Activation ac )
inline

Adds a convolutional layer to the neural network.

Parameters
num_filtersNumber of filters in the convolutional layer.
dimsDimensions of the filters.
weightsPointer to the weights array.
biasPointer to the bias array.
acActivation function to apply after the convolutional layer.
Returns
Reference to the NNBuilder object for method chaining.

◆ denseLayer() [1/2]

NNBuilder & NNBuilder::denseLayer ( int units,
int input_size,
Activation ac )
inline

Adds a dense layer to the neural network using weights and biases from files.

Parameters
unitsNumber of units in the dense layer.
input_sizeSize of the input to the dense layer.
acActivation function to apply after the dense layer.
Returns
Reference to the NNBuilder object for method chaining.

◆ denseLayer() [2/2]

NNBuilder & NNBuilder::denseLayer ( int units,
int input_size,
float * weights,
float * bias,
Activation ac )
inline

Adds a dense layer to the neural network.

Parameters
unitsNumber of units in the dense layer.
input_sizeSize of the input to the dense layer.
weightsPointer to the weights array.
biasPointer to the bias array.
acActivation function to apply after the dense layer.
Returns
Reference to the NNBuilder object for method chaining.

◆ maxPoolLayer()

NNBuilder & NNBuilder::maxPoolLayer ( int side,
int height,
int width )
inline

Adds a max pooling layer to the neural network.

Parameters
sideSize of the pooling window.
heightHeight of the input feature map.
widthWidth of the input feature map.
Returns
Reference to the NNBuilder object for method chaining.

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