Class TolerantLoss
Defined in File tolerant_loss.hpp
Inheritance Relationships
Base Type
public fuse_core::Loss
Class Documentation
-
class TolerantLoss : public fuse_core::Loss
The TolerantLoss loss function.
This class encapsulates the ceres::TolerantLoss class, adding the ability to serialize it and load it dynamically.
See the Ceres documentation for more details. http://ceres- solver.org/nnls_modeling.html::lossfunction
Public Functions
-
explicit TolerantLoss(const double a = 1.0, const double b = 0.1)
Constructor.
- Parameters:
a – [in] TolerantLoss parameter ‘a’. See Ceres documentation for more details
b – [in] TolerantLoss parameter ‘b’. See Ceres documentation for more details
-
~TolerantLoss() override = default
Destructor.
-
void initialize(fuse_core::node_interfaces::NodeInterfaces<fuse_core::node_interfaces::Base, fuse_core::node_interfaces::Logging, fuse_core::node_interfaces::Parameters> interfaces, const std::string &name) override
Perform any required post-construction initialization, such as reading from the parameter server.
This will be called on each plugin after construction.
- Parameters:
interfaces – [in] - The node interfaces used to load the parameter
name – [in] A unique name to initialize this plugin instance, such as from the parameter server.
-
void print(std::ostream &stream = std::cout) const override
Print a human-readable description of the loss function to the provided stream.
- Parameters:
stream – [out] The stream to write to. Defaults to stdout.
-
ceres::LossFunction *lossFunction() const override
Return a raw pointer to a ceres::LossFunction that implements the loss function.
The Ceres interface requires a raw pointer. Ceres will take ownership of the pointer and promises to properly delete the loss function when it is done. Additionally, Fuse promises that the Loss object will outlive any generated loss functions (i.e. the Ceres objects will be destroyed before the Loss Function objects). This guarantee may allow optimizations for the creation of the loss function objects.
- Returns:
A base pointer to an instance of a derived ceres::LossFunction.
-
inline double a() const
Parameter ‘a’ accessor.
- Returns:
Parameter ‘a’.
-
inline double b() const
Parameter ‘b’ accessor.
- Returns:
Parameter ‘b’.
-
inline void a(const double a)
Parameter ‘a’ mutator.
- Parameters:
a – [in] Parameter ‘a’.
-
inline void b(const double b)
Parameter ‘b’ mutator.
- Parameters:
b – [in] Parameter ‘b’.
Friends
- friend class boost::serialization::access
-
explicit TolerantLoss(const double a = 1.0, const double b = 0.1)