00001 /** 00002 * \file SteepestDescent.h \brief Simple steepest descent optimizer. 00003 * 00004 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00005 * 00006 */ 00007 00008 #ifndef IMPCORE_STEEPEST_DESCENT_H 00009 #define IMPCORE_STEEPEST_DESCENT_H 00010 00011 #include "core_config.h" 00012 00013 #include <IMP/Optimizer.h> 00014 00015 IMPCORE_BEGIN_NAMESPACE 00016 00017 //! A simple steepest descent optimizer 00018 /** Follow the gradient based on the partial derivatives. Multiply by the 00019 current step size. If the score gets worse, reduce the step size. 00020 If the score gets better, increase the step size if we are sufficiently 00021 far from a score of zero. If the score reaches the threshold, quit. 00022 */ 00023 class IMPCOREEXPORT SteepestDescent : public Optimizer 00024 { 00025 public: 00026 SteepestDescent(Model *m= NULL); 00027 00028 IMP_OPTIMIZER(SteepestDescent); 00029 00030 //! Set the minimum gradient threshold 00031 void set_threshold(Float t) {threshold_=t;} 00032 //! Set the step size 00033 void set_step_size(Float t) {step_size_=t;} 00034 00035 private: 00036 Float step_size_; 00037 Float threshold_; 00038 }; 00039 00040 IMPCORE_END_NAMESPACE 00041 00042 #endif /* IMPCORE_STEEPEST_DESCENT_H */