diff options
author | Luong Hoang <lhoang@live.com> | 2014-11-11 02:07:21 +0300 |
---|---|---|
committer | Luong Hoang <lhoang@live.com> | 2014-11-11 02:07:21 +0300 |
commit | 2d8ffeea6c63c407ed089df123d400e4847be574 (patch) | |
tree | ed8832eb412e96f1afea97c5c347da96f0ace61c /explore | |
parent | 21c048b78a188dbe6232adbd62d42b38aac5f179 (diff) | |
parent | de2af7a1baed4088da2bb076580c8cb943e836ad (diff) |
Merge branch 'v0' of https://github.com/sidsen/vowpal_wabbit into v0
Diffstat (limited to 'explore')
-rw-r--r-- | explore/ReadMe.txt | 2 | ||||
-rw-r--r-- | explore/static/MWTExplorer.h | 17 | ||||
-rw-r--r-- | explore/static/utility.h | 2 |
3 files changed, 7 insertions, 14 deletions
diff --git a/explore/ReadMe.txt b/explore/ReadMe.txt index 8413c3b9..21600456 100644 --- a/explore/ReadMe.txt +++ b/explore/ReadMe.txt @@ -1,4 +1,4 @@ This is the root of the exploration library and client-side decision service.
-sample.cpp shows how to use the exploration library which is a
+explore_sample.cpp shows how to use the exploration library which is a
header-only include in C++.
diff --git a/explore/static/MWTExplorer.h b/explore/static/MWTExplorer.h index 6714a964..3bf08703 100644 --- a/explore/static/MWTExplorer.h +++ b/explore/static/MWTExplorer.h @@ -203,8 +203,7 @@ private: u32 m_num_actions;
private:
- template <class Ctx>
- friend class MwtExplorer;
+ friend class MwtExplorer<Ctx>;
};
template <class Ctx>
@@ -283,8 +282,7 @@ private: u32 m_num_actions;
private:
- template <class Ctx>
- friend class MwtExplorer;
+ friend class MwtExplorer<Ctx>;
};
template <class Ctx>
@@ -313,8 +311,6 @@ private: throw std::invalid_argument("The number of weights returned by the scorer must equal number of actions");
}
- u32 chosen_action = 0;
-
// Create a discrete_distribution based on the returned weights. This class handles the
// case where the sum of the weights is < or > 1, by normalizing agains the sum.
float total = 0.f;
@@ -357,8 +353,7 @@ private: u32 m_num_actions;
private:
- template <class Ctx>
- friend class MwtExplorer;
+ friend class MwtExplorer<Ctx>;
};
template <class Ctx>
@@ -413,8 +408,7 @@ private: u32 m_num_actions;
private:
- template <class Ctx>
- friend class MwtExplorer;
+ friend class MwtExplorer<Ctx>;
};
template <class Ctx>
@@ -482,8 +476,7 @@ private: u32 m_num_actions;
private:
- template <class Ctx>
- friend class MwtExplorer;
+ friend class MwtExplorer<Ctx>;
}; template <class Ctx> diff --git a/explore/static/utility.h b/explore/static/utility.h index 1227e3b6..ffa57596 100644 --- a/explore/static/utility.h +++ b/explore/static/utility.h @@ -175,7 +175,7 @@ public: static void Float_To_String(float f, char* str)
{
int x = (int)f;
- int d = (int)(abs(f - x) * 100000);
+ int d = (int)(fabs(f - x) * 100000);
sprintf(str, "%d.%05d", x, d);
}
|