Class VirtualHyp

Class Documentation

class VirtualHyp

The VirtualHyp class represents virtual hyperplanes used for discretization.

This class provides functionality for creating and managing virtual hyperplanes, which are used to discretize continuous input variables for neural networks.

Public Functions

inline std::vector<float> &GetVirtHyp(int var)

Gets the virtual hyperplane for a specific variable.

Parameters:

var – The index of the variable.

Returns:

A reference to the vector of virtual hyperplane values.

inline std::vector<float> &GetEpsGoLeft(int var)

Gets the epsilon values for slightly left-shifted hyperplanes for a specific variable.

Parameters:

var – The index of the variable.

Returns:

A reference to the vector of epsilon values for slightly left-shifted hyperplanes.

inline std::vector<float> &GetEpsGoRight(int var)

Gets the epsilon values for slightly right-shifted hyperplanes for a specific variable.

Parameters:

var – The index of the variable.

Returns:

A reference to the vector of epsilon values for slightly right-shifted hyperplanes.

int KnotInd(int var, float val)

Finds the index of the lower nearest knot (threshold) in the virtual hyperplane for a given value.

Parameters:
  • var – The index of the variable.

  • val – The value to find the knot index for.

Returns:

The knot index, which represents the position of the nearest knot (threshold) that is less than or equal to the given value.

int GetInd(int var, float val)

Gets the index of the knot corresponding to a given value in the virtual hyperplanes.

Parameters:
  • var – The index of the variable.

  • val – The value to find the index for.

Returns:

The index of the value, or -1 if not found.

VirtualHyp(int nbBins, int nbIn, int multiple, float *bias, float *weights)

Constructs a VirtualHyp object with the given parameters.

Parameters:
  • nbBins – Number of bins for discretization.

  • nbIn – Number of input variables.

  • multiple – Multiple of the input variables.

  • bias – Pointer to the biases.

  • weights – Pointer to the weights.

VirtualHyp(int nbBins, int nbIn, int multiple, int nbNets, std::vector<std::shared_ptr<VirtualHyp>> virt)

Constructs a VirtualHyp object by merging multiple VirtualHyp objects.

Parameters:
  • nbBins – Number of bins for discretization.

  • nbIn – Number of input variables.

  • multiple – Multiple of the input variables.

  • nbNets – Number of networks.

  • virt – Vector of pointers to the VirtualHyp objects to merge.