Click or drag to resize
Accord.NET (logo)

GaussianFunction Class

Gaussian stochastic activation function.
Inheritance Hierarchy
SystemObject
  Accord.Neuro.ActivationFunctionsGaussianFunction

Namespace:  Accord.Neuro.ActivationFunctions
Assembly:  Accord.Neuro (in Accord.Neuro.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public class GaussianFunction : IStochasticFunction, 
	IActivationFunction
Request Example View Source

The GaussianFunction type exposes the following members.

Constructors
  NameDescription
Public methodGaussianFunction
Creates a new GaussianFunction.
Public methodGaussianFunction(Double)
Creates a new GaussianFunction.
Public methodGaussianFunction(Double, DoubleRange)
Initializes a new instance of the GaussianFunction class.
Top
Properties
  NameDescription
Public propertyAlpha
Linear slope value.
Public propertyRange
Function output range.
Top
Methods
  NameDescription
Public methodDerivative
Calculates function derivative.
Public methodDerivative2
Calculates function derivative.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFunction
Calculates function value.
Public methodGenerate
Samples a value from the function given a input value.
Public methodGenerate2
Samples a value from the function given a function output value.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

The Gaussian activation function can be used to create Stochastic Neurons, which can in turn be used to create Deep Belief Networks and Restricted Boltzmann Machines. In contrast to the BernoulliFunction, the Gaussian can be used to model continuous inputs in Deep Belief Networks. If, however, the inputs of the problem being learned are discrete in nature, the use of a Bernoulli function would be more indicated.

The Gaussian activation function is modeled after a Gaussian (Normal) probability distribution.

This function assumes output variables have been normalized to have zero mean and unit variance.

Examples
// Create a Gaussian function with slope alpha = 4.2
GaussianFunction function = new GaussianFunction(4.2);

// Computes the function output (linear, y = alpha * x)
double y = function.Function(x: 0.2); // 4.2 * 2 = 0.48

// Draws a sample from a Gaussian distribution with
// mean given by the function output y (previously 0.48)
double z = function.Generate(x: 0.4); // (random, between 0 and 1)

// Please note that the above is completely equivalent 
// to computing the line below (remember, 0.48 == y)
double w = function.Generate2(y: 0.48); // (random, between 0 and 1)


// We can also compute the derivative of the sigmoid function
double d = function.Derivative(x: 0.2); // 4.2 (the slope)

// Or compute the derivative given the functions' output y
double e = function.Derivative2(y: 0.2); // 4.2 (the slope)
See Also