theano/sandbox/rng_mrg.py
def truncated_normal(self, size, avg=0.0, std=1.0,
                         ndim=None, dtype=None, nstreams=None, **kwargs):
        """
        Sample a tensor of values from a symmetrically truncated normal distribution.

        Parameters
        ----------
        size : int_vector_like
            Array dimensions for the output tensor.
        avg : float_like, optional
            The mean value for the truncated normal to sample from (defaults to 0.0).
        std : float_like, optional
            The standard deviation for the truncated normal to sample from (defaults to 1.0).
        ndim : int, optional
            The number of dimensions for the output tensor (defaults to None).
            This argument is necessary if the size argument is ambiguous on the number of dimensions.
        dtype : str, optional
            The data-type for the output tensor. If not specified,
            the dtype is inferred from avg and std, but it is at least as precise as floatX.
        kwargs
            Other keyword arguments for random number generation (see uniform).

        Returns
        -------
        samples : TensorVariable
            A Theano tensor of samples randomly drawn from a truncated normal distribution.

        See Also
        --------
        normal
        """
        # constant taken from scipy.stats.truncnorm.std(a=-2, b=2, loc=0., scale=1.)
        std = std / tensor.constant(.87962566103423978)
        return self.normal(size=size, avg=avg, std=std, truncate=True,
                           ndim=ndim, dtype=dtype, nstreams=nstreams, **kwargs)

        Sample a tensor of values from a symmetrically truncated normal distribution.

        Parameters
        ----------
        size : int_vector_like
            Array dimensions for the output tensor.
        avg : float_like, optional
            The mean value for the truncated normal to sample from (defaults to 0.0).
        std : float_like, optional
            The standard deviation for the truncated normal to sample from (defaults to 1.0).
        ndim : int, optional
            The number of dimensions for the output tensor (defaults to None).
            This argument is necessary if the size argument is ambiguous on the number of dimensions.
        dtype : str, optional
            The data-type for the output tensor. If not specified,
            the dtype is inferred from avg and std, but it is at least as precise as floatX.
        kwargs
            Other keyword arguments for random number generation (see uniform).

        Returns
        -------
        samples : TensorVariable
            A Theano tensor of samples randomly drawn from a truncated normal distribution.

        See Also
        --------
        normal
        
Sample a tensor of values from a symmetrically truncated normal distribution.
Parameters

size : int_vector_like
Array dimensions for the output tensor.
avg : float_like, optional
The mean value for the truncated normal to sample from (defaults to 0.0).
std : float_like, optional
The standard deviation for the truncated normal to sample from (defaults to 1.0).
ndim : int, optional
The number of dimensions for the output tensor (defaults to None).
This argument is necessary if the size argument is ambiguous on the number of dimensions.
dtype : str, optional
The data-type for the output tensor. If not specified,
the dtype is inferred from avg and std, but it is at least as precise as floatX.
kwargs
Other keyword arguments for random number generation .

Returns

samples : TensorVariable
A Theano tensor of samples randomly drawn from a truncated normal distribution.

See Also

normal
Sample a tensor of values from a symmetrically truncated normal distribution . Parameters size : int_vector_like Array dimensions for the output tensor . avg : float_like optional The mean value for the truncated normal to sample from ( defaults to 0 . 0 ) . std : float_like optional The standard deviation for the truncated normal to sample from ( defaults to 1 . 0 ) . ndim : int optional The number of dimensions for the output tensor ( defaults to None ) . This argument is necessary if the size argument is ambiguous on the number of dimensions . dtype : str optional The data - type for the output tensor . If not specified the dtype is inferred from avg and std but it is at least as precise as floatX . kwargs Other keyword arguments for random number generation . Returns samples : TensorVariable A Theano tensor of samples randomly drawn from a truncated normal distribution . See Also normal
def truncated_normal(self, size, avg=0.0, std=1.0,
                         ndim=None, dtype=None, nstreams=None, **kwargs):
        std = std / tensor.constant(.87962566103423978)
        return self.normal(size=size, avg=avg, std=std, truncate=True,
                           ndim=ndim, dtype=dtype, nstreams=nstreams, **kwargs)
def truncated_normal ( self , size , avg = 0.0 , std = 1.0 , ndim = None , dtype = None , nstreams = None , ** kwargs ) : std = std / tensor . constant ( .87962566103423978 ) return self . normal ( size = size , avg = avg , std = std , truncate = True , ndim = ndim , dtype = dtype , nstreams = nstreams , ** kwargs )
Sample a tensor of values from a symmetrically truncated normal distribution.
Sample a tensor of values from a symmetrically truncated normal distribution .
"""
        Sample a tensor of values from a symmetrically truncated normal distribution.

        Parameters
        ----------
        size : int_vector_like
            Array dimensions for the output tensor.
        avg : float_like, optional
            The mean value for the truncated normal to sample from (defaults to 0.0).
        std : float_like, optional
            The standard deviation for the truncated normal to sample from (defaults to 1.0).
        ndim : int, optional
            The number of dimensions for the output tensor (defaults to None).
            This argument is necessary if the size argument is ambiguous on the number of dimensions.
        dtype : str, optional
            The data-type for the output tensor. If not specified,
            the dtype is inferred from avg and std, but it is at least as precise as floatX.
        kwargs
            Other keyword arguments for random number generation (see uniform).

        Returns
        -------
        samples : TensorVariable
            A Theano tensor of samples randomly drawn from a truncated normal distribution.

        See Also
        --------
        normal
        """ # constant taken from scipy.stats.truncnorm.std(a=-2, b=2, loc=0., scale=1.)
self
size
avg
std
ndim
dtype
nstreams