Show / Hide Table of Contents

Class Dense

Dense implements the operation: output = activation(dot(input, kernel) + bias) where activation is the element-wise activation function passed as the activation argument, kernel is a weights matrix created by the layer, and bias is a bias vector created by the layer (only applicable if use_bias is True).

Inheritance
System.Object
BaseLayer
Dense
Inherited Members
BaseLayer.Params
BaseLayer.Input
BaseLayer.Output
BaseLayer.Name
BaseLayer.SkipPred
BaseLayer.Item[String]
BaseLayer.BuildParam(String, Int64[], DataType, BaseInitializer, BaseConstraint, BaseRegularizer, Boolean)
Namespace: SiaNet.Layers
Assembly: SiaNet.dll
Syntax
public class Dense : BaseLayer

Constructors

| Improve this Doc View Source

Dense(Int32, ActType, BaseInitializer, BaseRegularizer, BaseConstraint, Boolean, BaseInitializer, BaseRegularizer, BaseConstraint)

Initializes a new instance of the Dense class.

Declaration
public Dense(int dim, ActType activation = ActType.Linear, BaseInitializer kernelInitializer = null, BaseRegularizer kernelRegularizer = null, BaseConstraint kernelConstraint = null, bool useBias = true, BaseInitializer biasInitializer = null, BaseRegularizer biasRegularizer = null, BaseConstraint biasConstraint = null)
Parameters
Type Name Description
System.Int32 dim

Dimensions of the output space

ActType activation

Activation function to use. If none specified linear activation will be used

BaseInitializer kernelInitializer

Initializer for kernel weight matrix.

BaseRegularizer kernelRegularizer

Regularizer function applied to bias weight matrix

BaseConstraint kernelConstraint

Constraint function applied to kernel weight matrix.

System.Boolean useBias

if set to true will use bias parameter.

BaseInitializer biasInitializer

Initializer for bias weight matrix

BaseRegularizer biasRegularizer

Regularizer function applied to bias weight matrix

BaseConstraint biasConstraint

Constraint function applied to bias weight matrix

Properties

| Improve this Doc View Source

Act

Activation function to use. If none specified linear activation will be used

Declaration
public BaseLayer Act { get; set; }
Property Value
Type Description
BaseLayer

The act.

| Improve this Doc View Source

BiasConstraint

Constraint function applied to bias weight matrix

Declaration
public BaseConstraint BiasConstraint { get; set; }
Property Value
Type Description
BaseConstraint

The bias constraint.

| Improve this Doc View Source

BiasInitializer

Initializer for bias weight matrix

Declaration
public BaseInitializer BiasInitializer { get; set; }
Property Value
Type Description
BaseInitializer

The bias initializer.

| Improve this Doc View Source

BiasRegularizer

Constraint function applied to bias weight matrix

Declaration
public BaseRegularizer BiasRegularizer { get; set; }
Property Value
Type Description
BaseRegularizer

The bias regularizer.

| Improve this Doc View Source

Dim

Dimensions of the output space

Declaration
public int Dim { get; set; }
Property Value
Type Description
System.Int32

The dim.

| Improve this Doc View Source

KernelConstraint

Constraint function applied to kernel weight matrix

Declaration
public BaseConstraint KernelConstraint { get; set; }
Property Value
Type Description
BaseConstraint

The kernel constraint.

| Improve this Doc View Source

KernelInitializer

Initializer for kernel weight matrix

Declaration
public BaseInitializer KernelInitializer { get; set; }
Property Value
Type Description
BaseInitializer

The kernel initializer.

| Improve this Doc View Source

KernelRegularizer

Regularizer function applied to kernel weight matrix

Declaration
public BaseRegularizer KernelRegularizer { get; set; }
Property Value
Type Description
BaseRegularizer

The kernel regularizer.

| Improve this Doc View Source

UseBias

Gets or sets a value indicating whether to use bias parameter.

Declaration
public bool UseBias { get; set; }
Property Value
Type Description
System.Boolean

true if [use bias]; otherwise, false.

Methods

| Improve this Doc View Source

Backward(Tensor)

Calculate the gradient of this layer function

Declaration
public override void Backward(Tensor outputgrad)
Parameters
Type Name Description
Tensor outputgrad

The calculated output grad from previous layer.

Overrides
BaseLayer.Backward(Tensor)
| Improve this Doc View Source

Forward(Tensor)

Forwards the inputs and compute the output

Declaration
public override void Forward(Tensor x)
Parameters
Type Name Description
Tensor x

The input tensor for this layer.

Overrides
BaseLayer.Forward(Tensor)

See Also

BaseLayer
  • Improve this Doc
  • View Source
Back to top Generated by DocFX