Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SigmoidFilter.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/simple_filters/SigmoidFilter.hh
11 
12 #ifndef INCLUDED_protocols_simple_filters_SigmoidFilter_hh
13 #define INCLUDED_protocols_simple_filters_SigmoidFilter_hh
14 
15 //unit headers
17 
18 // Project Headers
19 #include <core/types.hh>
21 #include <core/pose/Pose.fwd.hh>
24 
25 namespace protocols {
26 namespace simple_filters {
27 
28 ///@brief transform the output from a regular filter into a sigmoid ranging from 0-1 according to:
29 /// fx = 1/[1 + exp[ ( x - offset ) * steepness ]
30 /// The function asymptotically reaches 1 at negative values and 0 at positive values. It's 0.5 at the offset and steepness determines its slope at the offset
31 class Sigmoid : public filters::Filter
32 {
33  public:
34  Sigmoid();
35  virtual ~Sigmoid();
37  return new Sigmoid( *this );
38  }
40  return new Sigmoid();
41  }
42 
43  virtual bool apply( core::pose::Pose const & pose ) const;
44  virtual void report( std::ostream & out, core::pose::Pose const & pose ) const;
45  virtual core::Real report_sm( core::pose::Pose const & pose ) const;
46  void parse_my_tag( utility::tag::TagPtr const tag, moves::DataMap &, filters::Filters_map const &filters, moves::Movers_map const &, core::pose::Pose const & );
47  core::Real compute( core::pose::Pose const & pose ) const;
48  core::Real steepness() const{ return steepness_; }
49  void steepness( core::Real const s ){ steepness_ = s; }
50  core::Real offset(){ return offset_; }
51  void offset( core::Real const o ){ offset_ = o; }
52  bool negate() const{ return negate_; }
53  void negate( bool const b ){ negate_ = b; }
56  void reset_baseline( core::pose::Pose const & pose, bool const attempt_read_from_checkpoint ); /// allows within-trajectory resetting of the baseline. Notice this is nonconst, so can't be called from apply. attempt_read_from_checkpoint should be true for MC trials > 1, but false otherwise
57  core::Real threshold() const{ return threshold_; }
58  void threshold( core::Real const t ){ threshold_ = t; }
61  private:
64  core::Real offset_;/// dflt 0
65  core::Real baseline_; /// dflt 0; this is tricky; used internally to keep track of where the pose started. It is only reset by reset_baseline, and cannot, due to constness, be changed by apply
66  bool negate_; /// dflt false
67  core::Real threshold_; /// dflt 0 (always accept)
68  std::string baseline_checkpointing_filename_; // dflt ""; If this is set, the baseline value is saved to a checkpointing file to allow for recovery of the baseline after failure.
69 };
70 }
71 }
72 
73 #endif