11 #include <OpenMS/config.h>
85 template <
typename PeakContainerT>
87 const PeakContainerT& input_peak,
88 PeakContainerT& output_peak,
89 const double left_pos = 0.0,
90 const double right_pos = 0.0
106 const std::vector<double>& xs,
107 const std::vector<double>& ys,
129 const std::vector<double>& xs,
134 std::vector<double>& out_xs,
135 std::vector<double>& out_ys
164 const std::vector<double>& xs,
165 const std::vector<double>& ys,
166 std::vector<double>& TrX,
167 std::vector<double>& TrY
198 const std::vector<double>& xs,
199 const std::vector<double>& ys
221 const double prev_diff_E_param,
222 double& diff_E_param,
224 double& param_update,
226 const double current_E,
227 const double previous_E
246 const std::vector<double>& xs,
247 const std::vector<double>& ys,
270 const std::vector<double>& xs,
271 const std::vector<double>& ys,
294 const std::vector<double>& xs,
295 const std::vector<double>& ys,
318 const std::vector<double>& xs,
319 const std::vector<double>& ys,
342 const std::vector<double>& xs,
343 const std::vector<double>& ys,
423 const std::vector<double>& xs,
424 const std::vector<double>& ys,
440 const std::vector<double>& xs,
441 const std::vector<double>& ys,
442 std::vector<double>& TrX,
443 std::vector<double>& TrY
450 const std::vector<double>& xs,
451 const std::vector<double>& ys
458 const double prev_diff_E_param,
459 double& diff_E_param,
461 double& param_update,
463 const double current_E,
464 const double previous_E
468 prev_diff_E_param, diff_E_param, param_lr,
469 param_update, param, current_E, previous_E
484 const std::vector<double>& xs,
489 std::vector<double>& out_xs,
490 std::vector<double>& out_ys
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Definition: EmgGradientDescent.h:417
double computeInitialMean(const std::vector< double > &xs, const std::vector< double > &ys) const
Definition: EmgGradientDescent.h:449
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:457
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:422
double emg_point(const double x, const double h, const double mu, const double sigma, const double tau) const
Definition: EmgGradientDescent.h:496
void extractTrainingSet(const std::vector< double > &xs, const std::vector< double > &ys, std::vector< double > &TrX, std::vector< double > &TrY) const
Definition: EmgGradientDescent.h:439
EmgGradientDescent_friend()=default
double computeMuMaxDistance(const std::vector< double > &xs) const
Definition: EmgGradientDescent.h:434
~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:483
double compute_z(const double x, const double mu, const double sigma, const double tau) const
Definition: EmgGradientDescent.h:473
EmgGradientDescent emg_gd_
Definition: EmgGradientDescent.h:507
Compute the area, background and shape metrics of a peak.
Definition: EmgGradientDescent.h:40
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:404
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:407
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:413
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:44
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
const double PI
PI.
Definition: Constants.h:49
const double h
Definition: Constants.h:141
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22