IMP  2.2.0
The Integrative Modeling Platform
SteepestDescent.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/SteepestDescent.h \brief Simple steepest descent optimizer.
3  *
4  * Copyright 2007-2014 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPCORE_STEEPEST_DESCENT_H
9 #define IMPCORE_STEEPEST_DESCENT_H
10 
11 #include <IMP/core/core_config.h>
12 
13 #include <IMP/AttributeOptimizer.h>
14 
15 IMPCORE_BEGIN_NAMESPACE
16 
17 //! A simple steepest descent optimizer
18 /** Follow the gradient based on the partial derivatives. Multiply by the
19  current step size. If the score gets worse, reduce the step size.
20  If the score gets better, increase the step size if we are sufficiently
21  far from a score of zero. If the score reaches the threshold, quit.
22 */
23 class IMPCOREEXPORT SteepestDescent : public AttributeOptimizer {
24  public:
25  SteepestDescent(kernel::Model *m, std::string name = "SteepestDescent%1%");
26 
27  virtual Float do_optimize(unsigned int max_steps) IMP_OVERRIDE;
29 
30  //! Set the minimum gradient threshold
31  void set_threshold(Float t) { threshold_ = t; }
32  //! The starting step size
33  void set_step_size(Float t) { step_size_ = t; }
34  //! The maximum step size
35  void set_maximum_step_size(Float t) { max_step_size_ = t; }
36 
37  private:
38  Float step_size_;
39  Float max_step_size_;
40  Float threshold_;
41 };
42 
43 IMPCORE_END_NAMESPACE
44 
45 #endif /* IMPCORE_STEEPEST_DESCENT_H */
void set_maximum_step_size(Float t)
The maximum step size.
void set_threshold(Float t)
Set the minimum gradient threshold.
A simple steepest descent optimizer.
void set_step_size(Float t)
The starting step size.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
Import IMP/kernel/AttributeOptimizer.h in the namespace.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72