MCPcopy Create free account
hub / github.com/apache/singa / gaussian

Method gaussian

python/singa/tensor.py:513–529  ·  view source on GitHub ↗

Generate a value for each element following a Gaussian distribution. Args: mean (float): mean of the distribution std (float): standard variance of the distribution inplace: inplace flag Returns: this tensor

(self, mean, std, inplace=True)

Source from the content-addressed store, hash-verified

511 return self
512
513 def gaussian(self, mean, std, inplace=True):
514 '''Generate a value for each element following a Gaussian distribution.
515
516 Args:
517 mean (float): mean of the distribution
518 std (float): standard variance of the distribution
519 inplace: inplace flag
520
521 Returns:
522 this tensor
523 '''
524 if not inplace:
525 # return new tensor
526 raise NotImplementedError
527
528 singa.Gaussian(float(mean), float(std), self.data)
529 return self
530
531 def uniform(self, low, high, inplace=True):
532 '''Generate a value for each element following a uniform distribution.

Callers 15

_conv2d_helperMethod · 0.95
_avg_pool_helperMethod · 0.95
_max_pool_helperMethod · 0.95
_linear_helperMethod · 0.95
_inference_helperMethod · 0.95
_retraining_helperMethod · 0.95
test_randomMethod · 0.95
test_gaussian_gpuMethod · 0.95
_conv2d_helperMethod · 0.95
_conv_same_padMethod · 0.95

Calls 1

GaussianMethod · 0.80

Tested by 15

_conv2d_helperMethod · 0.76
_avg_pool_helperMethod · 0.76
_max_pool_helperMethod · 0.76
_linear_helperMethod · 0.76
_inference_helperMethod · 0.76
_retraining_helperMethod · 0.76
test_randomMethod · 0.76
test_gaussian_gpuMethod · 0.76
_conv2d_helperMethod · 0.76
_conv_same_padMethod · 0.76