示例#1
0
        public void TestMethod1()
        {
            Dictionary <string, int> dictionary = new Dictionary <string, int>();

            dictionary.Add("1", 1);
            dictionary.Add("2", 2);
            dictionary.Add("3", 3);
            dictionary.Add("4", 4);
            dictionary.Add("5", 5);
            ShuffleMethod method = new ShuffleMethod();
            var           sth    = method.shuffle(dictionary, 10, 3);
        }
示例#2
0
 /// <summary>
 ///   Creates a method to partition a given dataset into mini-batches of equal size.
 /// </summary>
 /// 
 /// <typeparam name="TInput">The type of the input data.</typeparam>
 /// <typeparam name="TOutput">The type of the output output.</typeparam>
 /// 
 /// <param name="input">The input data to be partitioned into mini-batches.</param>
 /// <param name="output">The output data to be partitioned into mini-batches.</param>
 /// <param name="weights">The weights for the data to be partitioned into mini-batches.</param>
 /// <param name="batchSize">The size of the batch.</param>
 /// <param name="maxIterations">The maximum number of mini-batches that should be created until the method stops.</param>
 /// <param name="maxEpochs">The maximum number of epochs that should be run until the method stops.</param>
 /// <param name="shuffle">The data shuffling options.</param>
 /// 
 public static Batches<TInput, TOutput> Create<TInput, TOutput>(
     TInput[] input, TOutput[] output, double[] weights = null,
     int batchSize = 32, int maxIterations = 0, int maxEpochs = 0,
     ShuffleMethod shuffle = ShuffleMethod.EveryEpoch)
 {
     return new Batches<TInput, TOutput>(input, output, weights)
     {
         MiniBatchSize = batchSize,
         MaxIterations = maxIterations,
         MaxEpochs = maxEpochs,
         Shuffle = shuffle
     };
 }
示例#3
0
 override public bool Init(string script)
 {
     if (base.Init(script))
     {
         s1 = CardCollectMethodParser.Parse(mapMethod["s1"]);
         s2 = ShuffleMethodParser.Parse(mapMethod["s2"]);
         s3 = DealMethodParser.Parse(mapMethod["s3"]);
         if (s1 != null
             && s2 != null
             && s3 != null)
         {
             return true;
         }
     }
     return false;
 }
示例#4
0
 override public bool Init(string script)
 {
     if (base.Init(script))
     {
         s1 = CardCollectMethodParser.Parse(mapMethod["s1"]);
         s2 = ShuffleMethodParser.Parse(mapMethod["s2"]);
         s3 = DealMethodParser.Parse(mapMethod["s3"]);
         if (s1 != null &&
             s2 != null &&
             s3 != null)
         {
             return(true);
         }
     }
     return(false);
 }
示例#5
0
 public Card[] Shuffle(int steps)
 {
     ShuffleMethod.Shuffle(Cards, steps);
     return(Cards);
 }