private void BrainTest(double factor, double expected)
        {
            _randomizer.GetDouble().Returns(factor);
            _brain.BuildNeuronLayers();

            var scores = _brain.Evaluate(_testPosition, 0);

            scores[48].Value.Should().Be(expected);
        }
Esempio n. 2
0
        public double[] Create(int n)
        {
            var factors = new List <double>();

            for (var j = 0; j < n; j++)
            {
                factors.Add(_randomizer.GetDouble());
            }
            return(factors.ToArray());
        }
Esempio n. 3
0
        public void Can_create_weight_factors()
        {
            const double newFactor = 0.2200134d;

            _randomizer.GetDouble().Returns(newFactor);

            var factors = _repository.Create(5);

            factors.Length.Should().Be(5);
            factors[0].Should().Be(newFactor);
        }