From 97ee4b54c7653c4a7e77faa3ab49cc9e42195dd3 Mon Sep 17 00:00:00 2001 From: Luong Hoang Date: Mon, 6 Oct 2014 11:37:44 -0400 Subject: [PATCH] reverted some changes that were lost during last merge --- explore/static/Interaction.h | 5 ++++- explore/tests/MWTExploreTests.cs | 6 +++--- vowpalwabbit/vw.sln | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/explore/static/Interaction.h b/explore/static/Interaction.h index e58f5c81f50..42c8fd2806e 100644 --- a/explore/static/Interaction.h +++ b/explore/static/Interaction.h @@ -57,6 +57,9 @@ class MWTAction : public Serializable u32 Get_Id() const { return m_id; } u32 Get_Id_ZeroBased() const { return m_id - 1; } + static u32 Make_OneBased(u32 id) { return id + 1; } + static u32 Make_ZeroBased(u32 id) { return id - 1; } + //TODO: Consider making this virtual and extensible (depends on ActionSet and what we expose to the user) bool Match(MWTAction& second_action) { @@ -92,7 +95,7 @@ class ActionSet MWTAction Get(u32 id) { - return m_action_set.at(id); + return m_action_set.at(MWTAction::Make_ZeroBased(id)); // Action ID is 1-based but index is 0-based } u32 Count() diff --git a/explore/tests/MWTExploreTests.cs b/explore/tests/MWTExploreTests.cs index ff141e14211..5858162670d 100644 --- a/explore/tests/MWTExploreTests.cs +++ b/explore/tests/MWTExploreTests.cs @@ -10,8 +10,9 @@ public class MWTExploreTests { [TestMethod] public void EpsilonGreedyStateful() - { - mwt.InitializeEpsilonGreedy(Epsilon, + { + float epsilon = 0; + mwt.InitializeEpsilonGreedy(epsilon, new StatefulPolicyDelegate(TestStatefulPolicyFunc), new IntPtr(PolicyParams), NumActions); @@ -86,7 +87,6 @@ private static void TestStatelessScorerFunc(IntPtr applicationContext, float[] s } private static readonly uint NumActions = 10; - private static readonly float Epsilon = 0.2f; private static readonly uint Tau = 5; private static readonly uint Bags = 2; private static readonly float Lambda = 0.5f; diff --git a/vowpalwabbit/vw.sln b/vowpalwabbit/vw.sln index c3c8accba56..16410f979fa 100644 --- a/vowpalwabbit/vw.sln +++ b/vowpalwabbit/vw.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.30501.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvw", "libvw.vcxproj", "{EA52DE0D-A5BE-4FB9-8C84-3A57BDFEBED9}" ProjectSection(ProjectDependencies) = postProject @@ -251,6 +251,7 @@ Global {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Debug|Mixed Platforms.Build.0 = Debug|x64 {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Debug|Win32.ActiveCfg = Debug|x64 {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Debug|x64.ActiveCfg = Debug|x64 + {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Debug|x64.Build.0 = Debug|x64 {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Debug|x86.ActiveCfg = Debug|x64 {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Release|Any CPU.ActiveCfg = Release|x64 {CB0C6B20-560C-4822-8EF6-DA999A64B542}.Release|Mixed Platforms.ActiveCfg = Release|x64