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
TInTOut
- 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
operationOperation<TIn, TOpOut>
Returns
- OperationListBuilder<TIn, TOpOut>
Type Parameters
TOpOut
Backward(object)
public override object Backward(object outputGradient)
Parameters
outputGradientobject
Returns
Backward(TOut)
Passes outputGradient backward through a series of operations.
public TIn Backward(TOut outputGradient)
Parameters
outputGradientTOut
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
inputTIninputGradientTIn
EnsureSameShapeForOutput(TOut?, TOut?)
[Conditional("DEBUG")]
protected abstract void EnsureSameShapeForOutput(TOut? output, TOut? outputGradient)
Parameters
outputTOutoutputGradientTOut
Forward(object, bool)
public override object Forward(object input, bool inference)
Parameters
Returns
Forward(TIn, bool)
Passes input forward through a series of operations.
public TOut Forward(TIn input, bool inference)
Parameters
inputTInInput matrix.
inferencebool
Returns
- TOut
Output matrix.
GetInputType()
public override Type GetInputType()
Returns
GetOutputType()
public override Type GetOutputType()
Returns
GetParamCount()
public override int GetParamCount()
Returns
SetupLayer()
protected virtual void SetupLayer()
UpdateParams(Optimizer)
public override void UpdateParams(Optimizer optimizer)
Parameters
optimizerOptimizer