示例#1
0
        public static void shuffle(this NumPyRandom rand, NDArray list)
        {
            var rng   = new Random();
            var count = list.size;

            while (count > 1)
            {
                count--;
                var k     = rng.Next(count + 1);
                var value = list[k];
                list[k]     = list[count];
                list[count] = value;
            }
        }
示例#2
0
        public NumPyRandom Random()
        {
            var rand = new NumPyRandom();

            return(rand);
        }
示例#3
0
        public void randint()
        {
            var a = new NumSharp.Core.NumPyRandom().randint(low: 0, high: 10, shape: new Shape(5, 5));

            Assert.IsTrue(a.Storage.GetData <int>().Count(x => x < 10) == 25);
        }
 public void normal()
 {
     var n = new NumSharp.Core.NumPyRandom().normal(0, 1, 5);
 }
 public void randn()
 {
     var n = new NumSharp.Core.NumPyRandom().randn(5, 2);
 }