org.nd4j.linalg.sampling
Class Sampling
- java.lang.Object
-
- org.nd4j.linalg.sampling.Sampling
-
public class Sampling extends java.lang.ObjectStatic methods for sampling from an ndarray
-
-
Constructor Summary
Constructors Constructor and Description Sampling()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static INDArraybinomial(INDArray p, int n, RandomGenerator rng)Generate a binomial distribution based on the given rng, a matrix of p values, and a max number.static INDArraynormal(RandomGenerator rng, INDArray mean, double sigma)A uniform sample ranging from 0 to sigma.static INDArraynormal(RandomGenerator rng, INDArray mean, INDArray sigma)A uniform sample ranging from 0 to sigma.
-
-
-
Method Detail
-
normal
public static INDArray normal(RandomGenerator rng, INDArray mean, INDArray sigma)
A uniform sample ranging from 0 to sigma.- Parameters:
rng- the rng to usemean,- the matrix mean from which to generate values fromsigma- the standard deviation to use to generate the gaussian noise- Returns:
- a uniform sample of the given shape and size with numbers between 0 and 1
-
normal
public static INDArray normal(RandomGenerator rng, INDArray mean, double sigma)
A uniform sample ranging from 0 to sigma.- Parameters:
rng- the rng to usemean,- the matrix mean from which to generate values fromsigma- the standard deviation to use to generate the gaussian noise- Returns:
- a uniform sample of the given shape and size with numbers between 0 and 1
-
binomial
public static INDArray binomial(INDArray p, int n, RandomGenerator rng)
Generate a binomial distribution based on the given rng, a matrix of p values, and a max number.- Parameters:
p- the p matrix to usen- the n to userng- the rng to use- Returns:
- a binomial distribution based on the one n, the passed in p values, and rng
-
-
DMelt 3.0 © DataMelt by jWork.ORG