IMP  2.1.1
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-2013 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  /** \deprecated_at{2.1} Use the constructor that takes a kernel::Model. */
26  IMPCORE_DEPRECATED_FUNCTION_DECL(2.1)
28  SteepestDescent(kernel::Model *m, std::string name = "SteepestDescent%1%");
29 
30  virtual Float do_optimize(unsigned int max_steps) IMP_OVERRIDE;
32 
33  //! Set the minimum gradient threshold
34  void set_threshold(Float t) { threshold_ = t; }
35  //! The starting step size
36  void set_step_size(Float t) { step_size_ = t; }
37  //! The maximum step size
38  void set_maximum_step_size(Float t) { max_step_size_ = t; }
39 
40  private:
41  Float step_size_;
42  Float max_step_size_;
43  Float threshold_;
44 };
45 
46 IMPCORE_END_NAMESPACE
47 
48 #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.