Table of Contents

Class Layer<TIn, TOut>

Namespace
NeuralNetworks.Layers
Assembly
NeuralNetworks.dll
public abstract class Layer<TIn, TOut> : Layer where TIn : notnull where TOut : notnull

Type Parameters

TIn
TOut
Inheritance
Layer<TIn, TOut>
Derived
Inherited Members

Properties

Input

protected TIn? Input { get; }

Property Value

TIn

Methods

AddOperation<TOpOut>(Operation<TIn, TOpOut>)

protected static OperationListBuilder<TIn, TOpOut> AddOperation<TOpOut>(Operation<TIn, TOpOut> operation) where TOpOut : notnull

Parameters

operation Operation<TIn, TOpOut>

Returns

OperationListBuilder<TIn, TOpOut>

Type Parameters

TOpOut

Backward(object)

public override object Backward(object outputGradient)

Parameters

outputGradient object

Returns

object

Backward(TOut)

Passes outputGradient backward through a series of operations.

public TIn Backward(TOut outputGradient)

Parameters

outputGradient TOut

Returns

TIn

Remarks

Checks appropriate shapes.

CreateOperationListBuilder()

public abstract OperationListBuilder<TIn, TOut> CreateOperationListBuilder()

Returns

OperationListBuilder<TIn, TOut>

EnsureSameShapeForInput(TIn?, TIn?)

[Conditional("DEBUG")]
protected abstract void EnsureSameShapeForInput(TIn? input, TIn? inputGradient)

Parameters

input TIn
inputGradient TIn

EnsureSameShapeForOutput(TOut?, TOut?)

[Conditional("DEBUG")]
protected abstract void EnsureSameShapeForOutput(TOut? output, TOut? outputGradient)

Parameters

output TOut
outputGradient TOut

Forward(object, bool)

public override object Forward(object input, bool inference)

Parameters

input object
inference bool

Returns

object

Forward(TIn, bool)

Passes input forward through a series of operations.

public TOut Forward(TIn input, bool inference)

Parameters

input TIn

Input matrix.

inference bool

Returns

TOut

Output matrix.

GetInputType()

public override Type GetInputType()

Returns

Type

GetOutputType()

public override Type GetOutputType()

Returns

Type

GetParamCount()

public override int GetParamCount()

Returns

int

SetupLayer()

protected virtual void SetupLayer()

UpdateParams(Optimizer)

public override void UpdateParams(Optimizer optimizer)

Parameters

optimizer Optimizer