Loading...
Searching...
No Matches
optimizer_base.h
Go to the documentation of this file.
1#ifndef _BBM_OPTIMIZER_BASE_H_
2#define _BBM_OPTIMIZER_BASE_H_
3
5
6/************************************************************************/
7/*! \file optimizer.h
8 \brief Abstract base definition of an optimizer (with virtual functions)
9
10 The key difference between an optimization_algorithm and optimizer is that
11 the former does not have virtual function, while the latters offers the same
12 functionality but with virtual functions.
13*************************************************************************/
14
15namespace bbm {
16
17 /**********************************************************************/
18 /*! \brief Abstract optimizer base class
19
20 **********************************************************************/
21 template<typename CONF> requires concepts::config<CONF>
23 {
25
26 //! \brief empty virtual base destructor
27 virtual ~optimizer_base(void) {}
28
29 /********************************************************************/
30 /*! \brief Perform one optimization step towards minimizing the loss.
31
32 \returns the loss before taking an optimzation step
33 *********************************************************************/
34 virtual Value step(void) = 0;
35
36 /********************************************************************/
37 /*! \brief Reset the internal state of the optimizer
38 ********************************************************************/
39 virtual void reset(void) = 0;
40
41 /********************************************************************/
42 /*! \brief Check if the optimizer has converged
43 *******************************************************************/
44 virtual Mask is_converged(void) = 0;
45 };
46
47} // end bbm namespace
48
49#endif /* _BBM_OPTIMIZER_BASE_H_ */
Optimizer contract: virtual interface wrapper around optimization_algorithms.
Definition: aggregatebsdf.h:29
Abstract optimizer base class.
Definition: optimizer_base.h:23
virtual Value step(void)=0
Perform one optimization step towards minimizing the loss.
virtual ~optimizer_base(void)
empty virtual base destructor
Definition: optimizer_base.h:27
virtual void reset(void)=0
Reset the internal state of the optimizer.
virtual Mask is_converged(void)=0
Check if the optimizer has converged.