Class Parameter
Placeholder variable for holding weight and bias for the neural network. Attached with constraints and regularizer to easy apply them during optimizer update operations
Namespace: SiaNet
Assembly: SiaNet.dll
Syntax
public class Parameter : BaseParameter
Constructors
| Improve this Doc View SourceParameter(String, DataType, Int64[])
Initializes a new instance of the Parameter class.
Declaration
public Parameter(string name, DataType dataType, params long[] shape)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the parameter. |
DataType | dataType | Data type |
System.Int64[] | shape | The shape of weight/bias parameter. |
Parameter(String, Int64[])
Initializes a new instance of the Parameter class.
Declaration
public Parameter(string name, params long[] shape)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the parameter. |
System.Int64[] | shape | The shape of the weight/bias parameter. |
Properties
| Improve this Doc View SourceHaveRegularizer
Gets a value indicating whether the parameter have regularizer function attached.
Declaration
public bool HaveRegularizer { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
| Improve this Doc View SourceApplyConstraint()
Applies the constraint function to weight/bias during training.
Declaration
public void ApplyConstraint()
ApplyDeltaRegularizer()
Applies the gradient of regularizer function during back propagation.
Declaration
public void ApplyDeltaRegularizer()
ApplyRegularizer()
Applies the regularizer function to weight/bias during training.
Declaration
public float ApplyRegularizer()
Returns
Type | Description |
---|---|
System.Single |
Create(Tensor, String)
Create an instance of parameter with tensor data.
Declaration
public static Parameter Create(Tensor data, string name = "")
Parameters
Type | Name | Description |
---|---|---|
Tensor | data | The tensor data to build the parameter. |
System.String | name | The name of the parameter. |
Returns
Type | Description |
---|---|
Parameter |
SetConstraint(BaseConstraint)
Sets the constraint function.
Declaration
public void SetConstraint(BaseConstraint fn)
Parameters
Type | Name | Description |
---|---|---|
BaseConstraint | fn | The function. |
SetRegularizer(BaseRegularizer)
Sets the regularizer function.
Declaration
public void SetRegularizer(BaseRegularizer fn)
Parameters
Type | Name | Description |
---|---|---|
BaseRegularizer | fn | The function. |