NetDEM v1.0
Loading...
Searching...
No Matches
netdem::MLPackUtils Class Reference

A class that defines several utility methods for ANN. More...

#include <mlpack_utils.hpp>

Public Types

enum class  LayerType {
  Identity , Linear , ReLU , LeakyReLU ,
  ELU , Softmax , LogSoftMax
}
 An enumeration of neural network layer types. More...
 

Static Public Member Functions

static double GetMSE (const arma::mat &pred, const arma::mat &Y)
 Calculates the mean squared error between predicted and ground truth data.
 
static double GetMAE (const arma::mat &pred, const arma::mat &Y)
 Calculates the mean absolute error between predicted and ground truth data.
 
static arma::mat GetLabels (const arma::mat &ann_outputs)
 Converts continuous output vectors to class labels.
 

Detailed Description

A class that defines several utility methods for ANN.

Member Enumeration Documentation

◆ LayerType

enum class netdem::MLPackUtils::LayerType
strong

An enumeration of neural network layer types.

The LayerType enumeration represents different types of neural network layers. It is used to specify which type of layer to add to a neural network model.

Enumerator
Identity 

The identity layer type.

Linear 

The linear layer type.

ReLU 

The rectified linear unit (ReLU) layer type.

LeakyReLU 

The leaky ReLU layer type.

ELU 

The exponential linear unit (ELU) layer type.

Softmax 

The softmax layer type.

LogSoftMax 

The log-softmax layer type.

Member Function Documentation

◆ GetLabels()

arma::mat netdem::MLPackUtils::GetLabels ( const arma::mat & ann_outputs)
static

Converts continuous output vectors to class labels.

This function converts continuous output vectors to class labels by selecting the index of the maximum value in each row.

Parameters
ann_outputsThe output data matrix.
Returns
The predicted class labels as a matrix of size (1 x num_samples).

◆ GetMAE()

double netdem::MLPackUtils::GetMAE ( const arma::mat & pred,
const arma::mat & Y )
static

Calculates the mean absolute error between predicted and ground truth data.

This function calculates the mean absolute error (MAE) between two matrices of predicted and ground truth data.

Parameters
predThe predicted data matrix.
YThe ground truth data matrix.
Returns
The calculated MAE as a scalar value.

◆ GetMSE()

double netdem::MLPackUtils::GetMSE ( const arma::mat & pred,
const arma::mat & Y )
static

Calculates the mean squared error between predicted and ground truth data.

This function calculates the mean squared error (MSE) between two matrices of predicted and ground truth data.

Parameters
predThe predicted data matrix.
YThe ground truth data matrix.
Returns
The calculated MSE as a scalar value.

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