Table Of Contents
Table Of Contents


class mxnet.initializer.Uniform(scale=0.07)[source]

Initializes weights with random values uniformly sampled from a given range.

Parameters:scale (float, optional) – The bound on the range of the generated random values. Values are generated from the range [-scale, scale]. Default scale is 0.07.


>>> # Given 'module', an instance of 'mxnet.module.Module', initialize weights
>>> # to random values uniformly sampled between -0.1 and 0.1.
>>> init = mx.init.Uniform(0.1)
>>> module.init_params(init)
>>> for dictionary in module.get_params():
...     for key in dictionary:
...         print(key)
...         print(dictionary[key].asnumpy())
[[ 0.01360891 -0.02144304  0.08511933]]

Initialize self. See help(type(self)) for accurate signature.


__init__([scale]) Initialize self.
dumps() Saves the initializer to string
set_verbosity([verbose, print_func]) Switch on/off verbose mode