예제 #1
0
        public void TestSoftmax()
        {
            var softmaxTests = new SoftmaxTestConfiguration[]
            {
                new SoftmaxTestConfiguration
                {
                    AppId                  = TestContext.TestName + "LowLambdaFixedActionContext",
                    ContextType            = ContextType.FixedAction, // test fixed-action context
                    Lambda                 = 0.1f,
                    NumberOfActions        = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration    = new FixedScorerConfiguration {
                        Score = 1
                    }
                },
                new SoftmaxTestConfiguration
                {
                    AppId                  = TestContext.TestName + "LowLambdaVariableActionContext",
                    ContextType            = ContextType.VariableAction, // test variable-action context
                    Lambda                 = 0.1f,
                    NumberOfActions        = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration    = new FixedScorerConfiguration {
                        Score = 5
                    }
                },

                new SoftmaxTestConfiguration
                {
                    AppId                  = TestContext.TestName + "HighLambdaFixedActionContext",
                    ContextType            = ContextType.FixedAction,
                    Lambda                 = 0.9f,
                    NumberOfActions        = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration    = new IntegerProgressionScorerConfiguration {
                        Start = 1
                    }
                },
                new SoftmaxTestConfiguration
                {
                    AppId                  = TestContext.TestName + "HighLambdaVariableActionContext",
                    ContextType            = ContextType.VariableAction,
                    Lambda                 = 0.9f,
                    NumberOfActions        = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration    = new IntegerProgressionScorerConfiguration {
                        Start = 5
                    }
                }
            };

            Run(outputFilePatternExpected, outputFilePatternActual, outputJsonConfigFile, softmaxTests);

            for (uint i = 0; i < softmaxTests.Length; i++)
            {
                CompareExplorationData(FormatPath(outputFilePatternExpected, i), FormatPath(outputFilePatternActual, i));
            }
        }
예제 #2
0
        public void TestSoftmax()
        {
            var softmaxTests = new SoftmaxTestConfiguration[]
            {
                new SoftmaxTestConfiguration
                {
                    AppId = TestContext.TestName + "LowLambdaFixedActionContext",
                    ContextType = ContextType.FixedAction, // test fixed-action context
                    Lambda = 0.1f,
                    NumberOfActions = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration = new FixedScorerConfiguration { Score = 1 }
                },
                new SoftmaxTestConfiguration
                {
                    AppId = TestContext.TestName + "LowLambdaVariableActionContext",
                    ContextType = ContextType.VariableAction, // test variable-action context
                    Lambda = 0.1f,
                    NumberOfActions = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration = new FixedScorerConfiguration { Score = 5 }
                },

                new SoftmaxTestConfiguration
                {
                    AppId = TestContext.TestName + "HighLambdaFixedActionContext",
                    ContextType = ContextType.FixedAction,
                    Lambda = 0.9f,
                    NumberOfActions = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration = new IntegerProgressionScorerConfiguration { Start = 1 }
                },
                new SoftmaxTestConfiguration
                {
                    AppId = TestContext.TestName + "HighLambdaVariableActionContext",
                    ContextType = ContextType.VariableAction,
                    Lambda = 0.9f,
                    NumberOfActions = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    ScorerConfiguration = new IntegerProgressionScorerConfiguration { Start = 5 }
                }
            };

            Run(outputFilePatternExpected, outputFilePatternActual, outputJsonConfigFile, softmaxTests);

            for (uint i = 0; i < softmaxTests.Length; i++)
            {
                CompareExplorationData(FormatPath(outputFilePatternExpected, i), FormatPath(outputFilePatternActual, i));
            }
        }