Show / Hide Table of Contents

Class BaseLoss

A loss function (or objective function, or optimization score function) is one of the two parameters required to compile a model.

Inheritance
System.Object
BaseLoss
BinaryCrossentropy
CategorialHinge
CategoricalCrossentropy
CosineProximity
Hinge
KullbackLeiblerDivergence
LogCosh
MeanAbsoluteError
MeanAbsolutePercentageError
MeanSquaredError
MeanSquaredLogError
Poisson
SquaredHinge
Namespace: SiaNet.Losses
Assembly: SiaNet.dll
Syntax
public abstract class BaseLoss

Constructors

| Improve this Doc View Source

BaseLoss(String)

Initializes a new instance of the BaseLoss class.

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

The name of the loss function.

Properties

| Improve this Doc View Source

Name

Gets or sets the name of the loss function

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

The name.

Methods

| Improve this Doc View Source

Backward(Tensor, Tensor)

Backpropagation method to calculate gradient of the loss function

Declaration
public abstract Tensor Backward(Tensor preds, Tensor labels)
Parameters
Type Name Description
Tensor preds

The predicted result.

Tensor labels

The true result.

Returns
Type Description
Tensor
| Improve this Doc View Source

Forward(Tensor, Tensor)

Forwards the inputs and calculate the loss.

Declaration
public abstract Tensor Forward(Tensor preds, Tensor labels)
Parameters
Type Name Description
Tensor preds

The predicted result.

Tensor labels

The true result.

Returns
Type Description
Tensor
  • Improve this Doc
  • View Source
Back to top Generated by DocFX