Activation function interface.
IActivationFunction
00 Remarks
All activation functions, which are supposed to be used with neurons, which calculate their output as a function of weighted sum of their inputs, should implement this interfaces.
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| CalculateDerivative | 1 | Calculates the derivative value of this activation function at the specific point, and the result will be truncated by the IActivationFunction.Truncate limitation. |
| Function | 1 | Calculates function value. |
| Derivative | 1 | Calculates function derivative. |
| ToString | 1 | 必须要重写这个函数来将函数对象序列化为表达式字符串文本 |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| Store | 1 | Gets the XML serializable data model of this activation function, so that the function object can be stored into a xml document. |
| Truncate | 1 | 因为激活函数在求导之后,结果值可能会出现无穷大 所以可以利用这个值来限制求导之后的结果最大值 |
| Evaluate | 2 | Evaluate the activation function value for each element in a given vector. |
04 Members
Double)Calculates the derivative value of this activation function at the specific point, and the result will be truncated by the IActivationFunction.Truncate limitation.
| Name | Type | Description |
|---|---|---|
x | Double | The function input value. |
The derivative value f'(x); the infinite value will be replaced by ±100000 and the NaN value will be replaced by 1.
Double)Calculates function value.
The method calculates function value at point x.
| Name | Type | Description |
|---|---|---|
x | Double | Function input value. |
Function output value, f(x).
Double)Calculates function derivative.
The method calculates function derivative at point x.
| Name | Type | Description |
|---|---|---|
x | Double | Function input value. |
Function derivative, f'(x).
必须要重写这个函数来将函数对象序列化为表达式字符串文本
The text expression of this activation function, which can be parsed back by the ActiveFunction.Parse() function.
Gets the XML serializable data model of this activation function, so that the function object can be stored into a xml document.
A ActiveFunction data model which can be serialized into a xml document.
因为激活函数在求导之后,结果值可能会出现无穷大 所以可以利用这个值来限制求导之后的结果最大值
The absolute value limitation of the derivative value; a value that is not a positive number means no truncation will be applied.
Double)Evaluate the activation function value at the specific point.
| Name | Type | Description |
|---|---|---|
x | Double | The function input value. |
The function output value f(x).
Vector)Evaluate the activation function value for each element in a given vector.
| Name | Type | Description |
|---|---|---|
a | Vector | A |
A new Vector in which each element is the function output value of the corresponding element in a.