SSELoss

scalation.modeling.autograd.SSELoss
case class SSELoss(pred: Variabl, target: Variabl)(using ops: AutogradOps) extends Function

Computes the Sum of Squared Errors (SSE) loss.

Value parameters

pred

the prediction variable.

target

the target variable.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Function
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def backward(gradOutput: TensorD): Unit

Backward pass: propagates the gradient scaled by 2*(pred - target).

Backward pass: propagates the gradient scaled by 2*(pred - target).

Value parameters

gradOutput

the upstream gradient.

Attributes

Definition Classes
override def forward(): Variabl

Forward pass: computes the SSE loss.

Forward pass: computes the SSE loss.

Attributes

Returns

a Variabl with loss data.

Definition Classes

Inherited methods

def attributes: Map[String, String]

Map of attributes for visualization/debugging (default: empty).

Map of attributes for visualization/debugging (default: empty).

Attributes

Inherited from:
Function
def backpropForTwoInputs(v1: Variabl, v2: Variabl, gradOutput: TensorD, computeGrad1: TensorD => TensorD, computeGrad2: TensorD => TensorD): Unit

Backpropagates gradients for functions with two inputs.

Backpropagates gradients for functions with two inputs.

Value parameters

computeGrad1

function to compute the gradient for v1.

computeGrad2

function to compute the gradient for v2.

gradOutput

the upstream gradient tensor.

v1

the first input variable.

v2

the second input variable.

Attributes

Inherited from:
Function
def inputs: Seq[Variabl]

Returns the input variables to this Function. This works automatically for all case-class ops by iterating over their constructor fields and collecting those of type Variabl.

Returns the input variables to this Function. This works automatically for all case-class ops by iterating over their constructor fields and collecting those of type Variabl.

Attributes

See also
Inherited from:
Function
def opName: String

Human-readable name of this op (defaults to simple class name).

Human-readable name of this op (defaults to simple class name).

Attributes

Inherited from:
Function
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
def unbroadcast(data: TensorD, oldShape: List[Int]): TensorD

Unbroadcasts a tensor to a given shape by summing across reduced dimensions.

Unbroadcasts a tensor to a given shape by summing across reduced dimensions.

Value parameters

data

the tensor data.

oldShape

the original shape.

Attributes

Returns

a TensorD with shape adjusted to oldShape.

Throws
Exception

if unbroadcasting is not feasible.

Inherited from:
Function
def unbroadcast(v: Variabl, oldShape: List[Int]): Variabl

Unbroadcasts a variable's tensor data to a specified old shape.

Unbroadcasts a variable's tensor data to a specified old shape.

Value parameters

oldShape

the target shape.

v

the variable to unbroadcast.

Attributes

Returns

a new Variabl with data unbroadcasted.

Inherited from:
Function

Inherited fields

val id: Int

Unique numeric ID for this Function node (for graph viz/debugging).

Unique numeric ID for this Function node (for graph viz/debugging).

Attributes

Inherited from:
Function