StoppingRule

scalation.modeling.neuralnet.StoppingRule
trait StoppingRule

The StoppingRule trait provides stopping rules to terminating the iterative steps in an optimization early.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def stopWhen(b: VectorD, sse: Double): (VectorD, Double)

Stop when too many steps have the cost measure (e.g., sse) increasing. Signal a stopping condition by returning the best parameter vector, else null.

Stop when too many steps have the cost measure (e.g., sse) increasing. Signal a stopping condition by returning the best parameter vector, else null.

Value parameters

b

the current value of the parameter vector

sse

the current value of cost measure (e.g., sum of squared errors)

Attributes

def stopWhen(b: NetParams, sse: Double): (NetParams, Double)

Stop when too many steps have the cost measure (e.g., sse) increasing. Signal a stopping condition by returning the best parameter vector, else null.

Stop when too many steps have the cost measure (e.g., sse) increasing. Signal a stopping condition by returning the best parameter vector, else null.

Value parameters

b

the current parameter value (weights and biases)

sse

the current value of cost measure (e.g., sum of squared errors)

Attributes

def stopWhenContinuous(params: IndexedSeq[Variabl], loss: Double, upLimit: Int): (IndexedSeq[Variabl], Double)

Stop when too many steps have the cost measure (e.g., loss) increasing. Signal a stopping condition by returning the best list of parameters, else null.

Stop when too many steps have the cost measure (e.g., loss) increasing. Signal a stopping condition by returning the best list of parameters, else null.

Value parameters

loss

the current loss value.

params

the current list of Variabl parameters (e.g., weights, biases).

upLimit

the maximum number of consecutive steps allowed without improvement.

Attributes

Returns

A tuple containing (best_params, best_loss) if patience is exceeded, else (null, best_loss).

def stopWhenPatience(params: IndexedSeq[Variabl], loss: Double, patience: Int): (IndexedSeq[Variabl], Double)

Early stopping with patience. If the loss does not improve (by more than EPSILON) for patience consecutive steps, signal a stopping condition by returning the best parameters and loss.

Early stopping with patience. If the loss does not improve (by more than EPSILON) for patience consecutive steps, signal a stopping condition by returning the best parameters and loss.

Value parameters

loss

the current loss value.

params

the current list of Variabl parameters (e.g., weights, biases).

patience

the number of epochs to waitLimit without improvement.

Attributes

Returns

A tuple containing (best_params, best_loss) if patience is exceeded, else (null, best_loss).

Concrete fields

protected val EPSILON: Double