00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef RF_FULL_HPP
00020 #define RF_FULL_HPP
00021
00022 #include <math.h>
00023
00024 #include <boost/numeric/ublas/vector_expression.hpp>
00025 #include <boost/numeric/ublas/io.hpp>
00026 #include <boost/program_options.hpp>
00027
00028 #include <fstream>
00029
00030 #include "types.hpp"
00031 #include "rf.hpp"
00032
00039 class RFFull : public RF {
00040
00049
00053
00054 Types::Matrix alpha;
00055
00059
00060 Types::Matrix meta_h,b;
00061
00063
00064
00073
00075
00076 Types::Matrix D;
00077
00079
00080 Types::Matrix M;
00081
00083
00084
00085
00086 Types::Matrix dwdM, dJ2dM, dJdM;
00087
00088
00089
00090 Types::Matrix dJ2_2dM_2, aux, dw_2dM_2, dJ_2dM_2;
00091
00092 public:
00093
00095 RFFull();
00096
00102 RFFull(Types::Input c);
00103
00107 RFFull(Types::Input c, const boost::program_options::variables_map& vm);
00108
00112 RFFull(const RFFull&, Types::Input c, const boost::program_options::variables_map& vm);
00113
00114
00121 virtual Types::RValue getActivation(Types::Input x) const
00122 {
00123 const_cast<Types::vector&>(temp2) = prod(M,(x-center));
00124 return exp(-0.5 * ublas::prec_inner_prod(temp2,temp2));
00125 };
00126
00127
00138 virtual Types::RValue learn(Types::Input x, Types::Output y, Types::RValueP w);
00139
00143 friend std::ostream& operator<<(std::ostream& out, const RFFull& rf);
00144
00148 Types::Matrix getAlpha() const { return alpha; };
00149 Types::Matrix getD() const { return D; };
00150 Types::Matrix getM() const { return M; };
00151 Types::Input getCenter() const { return center; };
00152
00153 };
00154
00155 #endif