T
- the sample type@FunctionalInterface public interface Error<T>
LossFunction
and, if desired, the
program Complexity
.
final Error<Double> error = Error.of(LossFunction::mse, Complexity.ofNodeCount(50));
LossFunction
,
Complexity
Modifier and Type | Method and Description |
---|---|
double |
apply(Tree<? extends Op<T>,?> program,
T[] calculated,
T[] expected)
Calculates the overall error of a given program tree.
|
static <T> Error<T> |
of(LossFunction<T> loss)
Creates an error function which only uses the given
loss function
for calculating the program error |
static <T> Error<T> |
of(LossFunction<T> loss,
Complexity<T> complexity)
Creates an error function by combining the given
loss function
and program complexity . |
static <T> Error<T> |
of(LossFunction<T> loss,
Complexity<T> complexity,
DoubleBinaryOperator compose)
Creates an error function by combining the given
loss function
and program complexity . |
double apply(Tree<? extends Op<T>,?> program, T[] calculated, T[] expected)
LossFunction
and, if desired, the program
Complexity
.program
- the program tree which calculated the calculated
valuescalculated
- the calculated function valuesexpected
- the expected function valuesNullPointerException
- if one of the arguments is null
static <T> Error<T> of(LossFunction<T> loss)
loss
function
for calculating the program errorT
- the sample typeloss
- the loss function to use for calculating the program errorNullPointerException
- if the given loss
function is
null
static <T> Error<T> of(LossFunction<T> loss, Complexity<T> complexity)
loss
function
and program complexity
. The loss function and program complexity
is combined in the following way: error = loss + loss*complexity
.
The complexity function penalizes programs which grows to big.T
- the sample typeloss
- the loss functioncomplexity
- the program complexity measureNullPointerException
- if one of the functions is null
static <T> Error<T> of(LossFunction<T> loss, Complexity<T> complexity, DoubleBinaryOperator compose)
loss
function
and program complexity
. The loss function and program complexity
is combined in the following way: error = loss + loss*complexity
.
The complexity function penalizes programs which grows to big.T
- the sample typeloss
- the loss functioncomplexity
- the program complexity measurecompose
- the function which composes the loss
and
complexity
functionNullPointerException
- if one of the functions is null
© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)