00001 #ifndef MLPOBJECTIVES_HPP_
00002 #define MLPOBJECTIVES_HPP_
00003
00004 #include<string>
00005 #include<vector>
00006
00007 using namespace std;
00008
00009 #include "Objectives.hpp"
00010
00015 namespace okind{
00016 enum MlpObjKind : int {
00017 None = 0,
00018 cwmse = 1<<1,
00019 cwmee = 1<<2,
00020 cwmae = 1<<3,
00021 cwerr = 1<<4,
00022 mse = 1<<5,
00023 mee = 1<<6,
00024 mae = 1<<7,
00025 err = 1<<8,
00026 mincwmse= 1<<9,
00027 mincwmee= 1<<10,
00028 mincwmae= 1<<11,
00029 mincwe= 1<<12,
00030 msw = 1<<13,
00031 mswnb = 1<<14,
00032 maw = 1<<15,
00033 mawnb = 1<<16,
00034 nhid = 1<<17,
00035 nnzw = 1<<18,
00036 ninput= 1<<19,
00037 vsmse = 1<<20,
00038 vsmee = 1<<21,
00039 vsmae = 1<<22,
00040 vserr = 1<<23,
00041 };
00042 }
00043 using okind::MlpObjKind;
00044
00045
00046 inline MlpObjKind operator|(MlpObjKind a, MlpObjKind b){
00047 return static_cast<MlpObjKind>(static_cast<int>(a)
00048 | static_cast<int>(b));}
00049 inline MlpObjKind operator&(MlpObjKind a, MlpObjKind b){
00050 return static_cast<MlpObjKind>(static_cast<int>(a)
00051 & static_cast<int>(b));}
00052
00053
00054
00055 namespace okind{
00056 inline
00057 bool needsClasswiseEvaluation(MlpObjKind k){
00058 return k & (cwmse|cwmee|cwmae|cwerr|mincwmse|mincwmee|mincwmae|mincwe);
00059 }
00060 }
00061
00062
00064 string mnemonic(MlpObjKind k);
00065
00077 class MlpObjectives : public Objectives {
00078 protected:
00079 size_t _nobj;
00080 vector<string> _objname;
00081 MlpObjKind _evokinds;
00082
00083 protected:
00088 void addKindIfInList(const vector<string> & spl, MlpObjKind k, size_t nclasses);
00089
00090 public:
00091 MlpObjectives() = delete;
00093 MlpObjectives(const string & defstr, size_t nclasses);
00094 virtual size_t nobj() const;
00095 virtual string name(size_t ind) const;
00096 MlpObjKind kinds() const;
00097
00098 };
00099
00100 #endif