mxnet.test_utils.mean_check¶
-
mxnet.test_utils.
mean_check
(generator, mu, sigma, nsamples=1000000)[source]¶ Test the generator by matching the mean.
- We test the sample mean by checking if it falls inside the range
(mu - 3 * sigma / sqrt(n), mu + 3 * sigma / sqrt(n))
References:
@incollection{goucher2009beautiful, title={Beautiful Testing: Leading Professionals Reveal How They Improve Software}, author={Goucher, Adam and Riley, Tim}, year={2009}, chapter=10 }
Examples:
generator = lambda x: np.random.normal(0, 1.0, size=x) mean_check_ret = mean_check(generator, 0, 1.0)
- Parameters
generator (function) – The generator function. It’s expected to generate N i.i.d samples by calling generator(N).
mu (float) –
sigma (float) –
nsamples (int) –
- Returns
ret – Whether the mean test succeeds
- Return type
bool