|
ʻOhana
Population structure, admixture history, and selection using learning methods.
|
7 #ifndef JADE_OPTIMIZER_HPP__
8 #define JADE_OPTIMIZER_HPP__
10 #include "jade.controller_factory.hpp"
17 template <
typename TValue>
48 std::cout <<
"iter\tduration\tdelta-lle\tlog-likelihood\n";
57 std::unique_ptr< controller_type > ctrl (
74 execute_args_type execute_args;
75 execute_args.
user = ctrl.get();
76 execute_args.logfunc = _logfunc;
77 if (opts.is_max_iterations_specified())
78 execute_args.max_iterations = opts.get_max_iterations();
79 if (opts.is_max_time_specified())
80 execute_args.max_seconds = opts.get_max_time();
81 if (opts.is_epsilon_specified())
82 execute_args.min_epsilon = opts.get_epsilon();
87 const auto condition = simplex.
execute(objfunc, execute_args);
100 assert(ctrl !=
nullptr);
101 ctrl->log_iteration(log_args);
106 #endif // JADE_OPTIMIZER_HPP__
virtual container_type init_parameters()=0
Creates and returns the initial set of parameters for the Nelder- Mead algorithm.
A template for a class that performs the Nelder-Mead optimization. This class implements shared featu...
value_type compute_objfunc(const container_type ¶ms)
Computes the objective function by decoding the specified Nelder- Mead parameters into a covariance m...
Arguments passed to the logging function.
const options_type & get_options() const
simplex_type::log_args log_args_type
The log arguments type for the simplex.
basic_controller< value_type > controller_type
The controller type.
Arguments to the execute method.
static controller_type * create(const settings_type &settings)
simplex_type::container_type container_type
The container type for the simplex.
A template for a class that implements the Nelder-Mead Simplex Method, which attempts to minimize an ...
static void execute(const settings_type &settings)
Executes the optimizer based on the specified settings.
std::vector< value_type > container_type
The container type.
void * user
User-supplied value.
A data structure used to initialize the Nelder-Mead algorithm.
virtual void emit_results(const options_type &opts, const simplex_type &simplex, const exit_condition_type &)
Writes results to standard output and files.
A template for a class encapsulating the settings provided to the optimizer.
controller_type::simplex_type simplex_type
The simplex type.
basic_controller_factory< value_type > controller_factory_type
The controller factory type.
TValue value_type
The value type.
basic_options< value_type > options_type
The options type.
exit_condition_type execute(const TObjfunc objfunc, const execute_args &exe_args)
Calls the iterate method until an exit condition is reached.
basic_settings< value_type > settings_type
The settings type.
A template for a class that creates controllers that use or do not use Newick trees specified on the ...