public void CanCreate_FromExisting()
        {
            var expected = GradientDescentOptions.DefaultSmall;
            var actual   = new GradientDescentOptions(expected);

            Assert.Equal(expected, actual);
        }
예제 #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="GradientDescentOptions" /> struct given an
 ///     existing one.
 /// </summary>
 /// <param name="options">Options to duplicate.</param>
 public GradientDescentOptions(GradientDescentOptions options)
 {
     this.Limit          = options.Limit;
     this.MaxIterations  = options.MaxIterations;
     this.DerivativeStep = options.DerivativeStep;
     this.LearningRate   = options.LearningRate;
     this.ErrorThreshold = options.ErrorThreshold;
 }
        public void CanCreate_Default()
        {
            var actual   = GradientDescentOptions.Default;
            var expected = new GradientDescentOptions(
                0.001,
                10000,
                0.01,
                20,
                .01
                );

            Assert.Equal(expected, actual);
        }