MCPcopy Create free account
hub / github.com/TUC-ProAut/libRSF / Evaluate

Method Evaluate

src/error_models/LossFunction.cpp:32–46  ·  view source on GitHub ↗

@brief implements the original DCS loss function * * @param s squared non-weighted error * @param rho [p(s) p'(s) p''(s)] */

Source from the content-addressed store, hash-verified

30 * @param rho [p(s) p'(s) p''(s)]
31 */
32 void DCSLoss::Evaluate(double s, double rho[3]) const
33 {
34 if (s <= Phi_)
35 {
36 rho[0] = s;
37 rho[1] = 1;
38 rho[2] = 0;
39 }
40 else
41 {
42 rho[0] = Phi_ * (3 * s - Phi_) / (s + Phi_);
43 rho[1] = (3*Phi_)/(Phi_ + s) + (Phi_*(Phi_ - 3*s))/pow((Phi_ + s), 2);
44 rho[2] = - (6*Phi_)/pow((Phi_ + s), 2) - (2*Phi_*(Phi_ - 3*s))/pow((Phi_ + s), 3);
45 }
46 }
47
48 /** @brief implements the a new DCS like loss function which is closer related to the mathematical meaning of a gauss distribution
49 *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected