Show / Hide Table of Contents

Class BaseLayer

Base class for the layers

Inheritance
System.Object
BaseLayer
Elu
Exp
HardSigmoid
LeakyRelu
Linear
PRelu
Relu
Sigmoid
Softmax
Softplus
Softsign
Tanh
AvgPooling1D
AvgPooling2D
AvgPooling3D
BatchNormalization
Conv1D
Conv2D
Conv2DTranspose
Conv3D
Conv3DTranspose
Dense
Dropout
Embedding
Flatten
GlobalPooling1D
GlobalPooling2D
GlobalPooling3D
MaxPooling1D
MaxPooling2D
MaxPooling3D
Permute
Repeat
Reshape
Namespace: SiaNet.Layers
Assembly: SiaNet.dll
Syntax
public abstract class BaseLayer

Constructors

| Improve this Doc View Source

BaseLayer(String)

Initializes a new instance of the BaseLayer class.

Declaration
public BaseLayer(string name)
Parameters
Type Name Description
System.String name

The name.

Fields

| Improve this Doc View Source

Input

The input tensor parameter

Declaration
[NonSerialized]
public Parameter Input
Field Value
Type Description
Parameter
| Improve this Doc View Source

Output

The output tensor parameter

Declaration
[NonSerialized]
public Tensor Output
Field Value
Type Description
Tensor
| Improve this Doc View Source

Params

The parameters list used by the layer

Declaration
[NonSerialized]
public Dictionary<string, Parameter> Params
Field Value
Type Description
System.Collections.Generic.Dictionary<System.String, Parameter>

Properties

| Improve this Doc View Source

Item[String]

Gets or sets the Parameter with the specified name.

Declaration
public Parameter this[string name] { get; set; }
Parameters
Type Name Description
System.String name

The name.

Property Value
Type Description
Parameter

The Parameter.

| Improve this Doc View Source

Name

Gets or sets the name of the layer

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

The name.

| Improve this Doc View Source

SkipPred

Gets or sets a value indicating whether the layer is train only

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

true if [skip pred]; otherwise, false.

Methods

| Improve this Doc View Source

Backward(Tensor)

Calculate the gradient of this layer function

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

The calculated output grad from previous layer.

| Improve this Doc View Source

BuildParam(String, Int64[], DataType, BaseInitializer, BaseConstraint, BaseRegularizer, Boolean)

Builds the parameter with specified parameter. Used to create weight or bias parameter for the layer.

Declaration
public Parameter BuildParam(string name, long[] shape, DataType elementType, BaseInitializer initializer, BaseConstraint constraint = null, BaseRegularizer regularizer = null, bool trainable = true)
Parameters
Type Name Description
System.String name

The name of the parameter.

System.Int64[] shape

The shape of the tensor.

DataType elementType

Datatype of the tensor.

BaseInitializer initializer

The initializer used to create the parameter.

BaseConstraint constraint

The constraint function applied for this parameter.

BaseRegularizer regularizer

The regularizer function for this parameter.

System.Boolean trainable

if set to true [trainable].

Returns
Type Description
Parameter
| Improve this Doc View Source

Forward(Tensor)

Forwards the inputs and compute the output

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

The input tensor for this layer.

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