37 #include <OpenMS/config.h>
111 template <
typename PeakContainerT>
113 const PeakContainerT& input_peak,
114 PeakContainerT& output_peak,
115 const double left_pos = 0.0,
116 const double right_pos = 0.0
132 const std::vector<double>& xs,
133 const std::vector<double>& ys,
155 const std::vector<double>& xs,
160 std::vector<double>& out_xs,
161 std::vector<double>& out_ys
190 const std::vector<double>& xs,
191 const std::vector<double>& ys,
192 std::vector<double>& TrX,
193 std::vector<double>& TrY
224 const std::vector<double>& xs,
225 const std::vector<double>& ys
247 const double prev_diff_E_param,
248 double& diff_E_param,
250 double& param_update,
252 const double current_E,
253 const double previous_E
272 const std::vector<double>& xs,
273 const std::vector<double>& ys,
296 const std::vector<double>& xs,
297 const std::vector<double>& ys,
320 const std::vector<double>& xs,
321 const std::vector<double>& ys,
344 const std::vector<double>& xs,
345 const std::vector<double>& ys,
368 const std::vector<double>& xs,
369 const std::vector<double>& ys,
449 const std::vector<double>& xs,
450 const std::vector<double>& ys,
466 const std::vector<double>& xs,
467 const std::vector<double>& ys,
468 std::vector<double>& TrX,
469 std::vector<double>& TrY
476 const std::vector<double>& xs,
477 const std::vector<double>& ys
484 const double prev_diff_E_param,
485 double& diff_E_param,
487 double& param_update,
489 const double current_E,
490 const double previous_E
494 prev_diff_E_param, diff_E_param, param_lr,
495 param_update, param, current_E, previous_E
510 const std::vector<double>& xs,
515 std::vector<double>& out_xs,
516 std::vector<double>& out_ys
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
Definition: EmgGradientDescent.h:443
double computeInitialMean(const std::vector< double > &xs, const std::vector< double > &ys) const
Definition: EmgGradientDescent.h:475
void iRpropPlus(const double prev_diff_E_param, double &diff_E_param, double ¶m_lr, double ¶m_update, double ¶m, const double current_E, const double previous_E) const
Definition: EmgGradientDescent.h:483
double Loss_function(const std::vector< double > &xs, const std::vector< double > &ys, const double h, const double mu, const double sigma, const double tau) const
Definition: EmgGradientDescent.h:448
double emg_point(const double x, const double h, const double mu, const double sigma, const double tau) const
Definition: EmgGradientDescent.h:522
void extractTrainingSet(const std::vector< double > &xs, const std::vector< double > &ys, std::vector< double > &TrX, std::vector< double > &TrY) const
Definition: EmgGradientDescent.h:465
EmgGradientDescent_friend()=default
double computeMuMaxDistance(const std::vector< double > &xs) const
Definition: EmgGradientDescent.h:460
~EmgGradientDescent_friend()=default
void applyEstimatedParameters(const std::vector< double > &xs, const double h, const double mu, const double sigma, const double tau, std::vector< double > &out_xs, std::vector< double > &out_ys) const
Definition: EmgGradientDescent.h:509
double compute_z(const double x, const double mu, const double sigma, const double tau) const
Definition: EmgGradientDescent.h:499
EmgGradientDescent emg_gd_
Definition: EmgGradientDescent.h:533
Compute the area, background and shape metrics of a peak.
Definition: EmgGradientDescent.h:66
double E_wrt_mu(const std::vector< double > &xs, const std::vector< double > &ys, const double h, const double mu, const double sigma, const double tau) const
Compute the cost given by the partial derivative of the loss function E, with respect to `mu` (the me...
UInt print_debug_
Definition: EmgGradientDescent.h:430
double computeInitialMean(const std::vector< double > &xs, const std::vector< double > &ys) const
Compute an estimation of the mean of a peak.
void iRpropPlus(const double prev_diff_E_param, double &diff_E_param, double ¶m_lr, double ¶m_update, double ¶m, const double current_E, const double previous_E) const
Apply the iRprop+ algorithm for gradient descent.
double Loss_function(const std::vector< double > &xs, const std::vector< double > &ys, const double h, const double mu, const double sigma, const double tau) const
Compute the cost given by loss function E.
void fitEMGPeakModel(const PeakContainerT &input_peak, PeakContainerT &output_peak, const double left_pos=0.0, const double right_pos=0.0) const
Fit the given peak (either MSChromatogram or MSSpectrum) to the EMG peak model.
double E_wrt_tau(const std::vector< double > &xs, const std::vector< double > &ys, const double h, const double mu, const double sigma, const double tau) const
Compute the cost given by the partial derivative of the loss function E, with respect to `tau` (the e...
double emg_point(const double x, const double h, const double mu, const double sigma, const double tau) const
Compute the EMG function on a single point.
void extractTrainingSet(const std::vector< double > &xs, const std::vector< double > &ys, std::vector< double > &TrX, std::vector< double > &TrY) const
Given a peak, extract a training set to be used with the gradient descent algorithm.
UInt max_gd_iter_
Maximum number of gradient descent iterations in `fitEMGPeakModel()`.
Definition: EmgGradientDescent.h:433
double E_wrt_h(const std::vector< double > &xs, const std::vector< double > &ys, const double h, const double mu, const double sigma, const double tau) const
Compute the cost given by the partial derivative of the loss function E, with respect to `h` (the amp...
EmgGradientDescent()
Constructor.
bool compute_additional_points_
Definition: EmgGradientDescent.h:439
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
void getDefaultParameters(Param ¶ms)
double computeMuMaxDistance(const std::vector< double > &xs) const
Compute the boundary for the mean (`mu`) parameter in gradient descent.
void applyEstimatedParameters(const std::vector< double > &xs, const double h, const double mu, const double sigma, const double tau, std::vector< double > &out_xs, std::vector< double > &out_ys) const
Compute the EMG function on a set of points.
~EmgGradientDescent() override=default
Destructor.
double compute_z(const double x, const double mu, const double sigma, const double tau) const
Compute EMG's z parameter.
double E_wrt_sigma(const std::vector< double > &xs, const std::vector< double > &ys, const double h, const double mu, const double sigma, const double tau) const
Compute the cost given by the partial derivative of the loss function E, with respect to `sigma` (the...
UInt estimateEmgParameters(const std::vector< double > &xs, const std::vector< double > &ys, double &best_h, double &best_mu, double &best_sigma, double &best_tau) const
The implementation of the gradient descent algorithm for the EMG peak model.
Management and storage of parameters / INI files.
Definition: Param.h:70
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
const double PI
PI.
Definition: Constants.h:75
const double h
Definition: Constants.h:162
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47