我正在尝试生成并重新生成随机法线的向量
我希望能够通过生成大小为100x3的随机法线矩阵和平均值为0和sd 1的随机法线来实现以下目标:
seed1 = '123'
seed2 = 'asd'
randMatrixrows = 100
randMatrixcols = 3
mu = 0
sd = 1
normRand1 = rekina_normRandomGenerator( seed1, randMatrixrows, randMatrixcols, mu, sd ) #normRand1 is of size 100x3
normRand2 = rekina_normRandomGenerator( seed2, randMatrixrows, randMatrixcols, mu, sd )
normRand3 = rekina_normRandomGenerator( seed1, randMatrixrows, randMatrixcols, mu, sd )
normRand4 = rekina_normRandomGenerator( seed2, randMatrixrows, randMatrixcols, mu, sd )
err1 = normRand1 - normRand3
err2 = normRand2 - normRand4
err1和err2的每个元素都应为0
我也尝试过阅读,但是作为Python的新手,我对实现完全失去了兴趣。我希望有一个简单的实现来展示如何使用CBRNG。在
您最初假设必须使用^{} 是正确的。它似乎提供了大量的sources of pseudo randomness(基于基于计数器的rng)和distributions,这可能会令人困惑。它还提供shortcuts来创建具有给定分布的随机数生成器。在
要想看到它的实际效果,请添加:
^{pr2}$这取决于执行的质量。下面是两组带有种子0和1的数字的绘制方法:
免责声明
这是我第一次和雷克纳见面。上述代码可能无法及时释放资源和/或像筛子一样泄漏。它使用全局^{} ,这可能不是您在更大的应用程序中想要的。在
PS
也生成形状为(100,3)的正态分布随机数数组,尽管它不使用GPU。在
相关问题 更多 >
编程相关推荐