Cost refers to the loss function used to train the model. Each cost
Cost. Neon currently supports the
following cost functions:
||\(\sum t log(y)\)|
||Smooth \(L_1\) loss (see Girshick 2015)|
y(Tensor or OpTree): Output of model
t(Tensor or OpTree): True targets corresponding to y
and returns an OpTree with the cost and the derivative for
We define metrics to evaluate the performance of a trained model.
Similar to costs, each metric takes as input the output of the model
y and the true targets
t. Metrics may be initialized with
additional parameters. Each metric returns a numpy array of the metric.
Neon supports the following metrics:
||Incorrect rate from Top \(K\) guesses|
||Class averaged precision (item 0) and recall (item 1) values.|
||Correct rate (item 0) and L1 loss on the bounding box (item 1)|
To create your own metric, subclass from
Metric and implement the
__call__() method, which takes as input Tensors
returns a numpy array of the resulting metrics. If you need to allocate
buffer space for the backend to store calculations, or accept additional
parameters, remember to do so in the class constructor.