GClasses
GClasses::GNeuralNetPseudoInverse Class Reference

Approximates the inverse of a neural network. (This only works well if the neural network is mostly invertible. For example, if the neural network only deviates a little from the identity function, then this will work well. With many interesting problems, this gives very poor results.) Note: This class assumes that the activation functions used within each layer of the neural network are homogeneous. More...

#include <GNeuralNet.h>

Public Member Functions

 GNeuralNetPseudoInverse (GNeuralNet *pNN, double padding=0.01)
 padding specifies a margin in which label values will be clipped inside the activation function output range to avoid extreme feature values (-inf, inf, etc.). More...
 
 ~GNeuralNetPseudoInverse ()
 
void computeFeatures (const double *pLabels, double *pFeatures)
 Computes the input features from the output labels. In cases of under-constraint, the feature vector with the minimum magnitude is chosen. In cases of over-constraint, the feature vector is chosen with a corresponding label vector that minimizes sum-squared error with the specified label vector. More...
 

Static Public Member Functions

static void test ()
 

Protected Attributes

std::vector
< GNeuralNetInverseLayer * > 
m_layers
 
double m_padding
 
double * m_pBuf1
 
double * m_pBuf2
 

Detailed Description

Approximates the inverse of a neural network. (This only works well if the neural network is mostly invertible. For example, if the neural network only deviates a little from the identity function, then this will work well. With many interesting problems, this gives very poor results.) Note: This class assumes that the activation functions used within each layer of the neural network are homogeneous.

Constructor & Destructor Documentation

GClasses::GNeuralNetPseudoInverse::GNeuralNetPseudoInverse ( GNeuralNet pNN,
double  padding = 0.01 
)

padding specifies a margin in which label values will be clipped inside the activation function output range to avoid extreme feature values (-inf, inf, etc.).

GClasses::GNeuralNetPseudoInverse::~GNeuralNetPseudoInverse ( )

Member Function Documentation

void GClasses::GNeuralNetPseudoInverse::computeFeatures ( const double *  pLabels,
double *  pFeatures 
)

Computes the input features from the output labels. In cases of under-constraint, the feature vector with the minimum magnitude is chosen. In cases of over-constraint, the feature vector is chosen with a corresponding label vector that minimizes sum-squared error with the specified label vector.

static void GClasses::GNeuralNetPseudoInverse::test ( )
static

Member Data Documentation

std::vector<GNeuralNetInverseLayer*> GClasses::GNeuralNetPseudoInverse::m_layers
protected
double GClasses::GNeuralNetPseudoInverse::m_padding
protected
double* GClasses::GNeuralNetPseudoInverse::m_pBuf1
protected
double* GClasses::GNeuralNetPseudoInverse::m_pBuf2
protected