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

Method gaussian

examples/model_selection/Trails/singa_pkg_code/tensor.py:482–498  ·  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

480 return self
481
482 def gaussian(self, mean, std, inplace=True):
483 '''Generate a value for each element following a Gaussian distribution.
484
485 Args:
486 mean (float): mean of the distribution
487 std (float): standard variance of the distribution
488 inplace: inplace flag
489
490 Returns:
491 this tensor
492 '''
493 if not inplace:
494 # return new tensor
495 raise NotImplementedError
496
497 singa.Gaussian(float(mean), float(std), self.data)
498 return self
499
500 def uniform(self, low, high, inplace=True):
501 '''Generate a value for each element following a uniform distribution.

Callers 6

trainFunction · 0.95
trainFunction · 0.95
initializeMethod · 0.45
initializeMethod · 0.45
initializeMethod · 0.45
imdb_train.pyFile · 0.45

Calls 1

GaussianMethod · 0.80

Tested by

no test coverage detected