-
Notifications
You must be signed in to change notification settings - Fork 101
some problem in build random array #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
fixed. these tests run through now: [TestMethod]
public void randTest()
{
// >>> np.random.rand(3,2)
// array([[ 0.14022471, 0.96360618], #random
// [ 0.37601032, 0.25528411], #random
// [ 0.49313049, 0.94909878]]) #random
//
np.random.seed(0);
var given= np.random.rand(1,2);
var expected = "array([[0.5488135 , 0.71518937]])";
Assert.AreEqual(expected, given.repr);
np.random.seed(0);
float x = np.random.rand();
Assert.AreEqual(0.5488135039273248f, x);
}
[TestMethod]
public void randnTest()
{
// >>> np.random.randn()
// 2.1923875335537315 #random
//
np.random.seed(0);
var given = np.random.randn();
Assert.AreEqual(1.76405239f, given);
// Two-by-four array of samples from N(3, 6.25):
// >>> 2.5 * np.random.randn(2, 4) + 3
// array([[-4.49401501, 4.00950034, -1.81814867, 7.29718677], #random
// [ 0.39924804, 4.68456316, 4.99394529, 4.84057254]]) #random
//
np.random.seed(0);
var a = 2.5 * np.random.randn(1, 2) + 3;
var expected= "array([[7.41013086, 4.00039302]])";
Assert.AreEqual(expected, a.repr);
} the fix is gonna be released shortly. thanks for the bug reports! |
henon
added a commit
to SciSharp/CodeMinion
that referenced
this issue
Jun 30, 2019
henon
added a commit
that referenced
this issue
Jun 30, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var a1 = np.random.rand(300, 200);
Python.Runtime.PythonException:“TypeError : rand() got an unexpected keyword argument 'd0'”
var a1 = np.random.randn(300, 200);
Python.Runtime.PythonException:“TypeError : randn() got an unexpected keyword argument 'd0'”
The text was updated successfully, but these errors were encountered: