<commit_before>from abstract import layer
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import theano
import numpy

class random_layer (layer):
    """
    This is a random generation layer. 

    Args: 
        num_neurons: List of the shapes of all inputs.
        distribution: ``'binomial'``, ``'uniform'``, ``'normal'`` ``'gaussian'``
        limits: tuple for binomial
        mu: mean for gaussian
        sigma: variance for gaussian
        p: if ``type`` is ``'binomial'`` supply a ``p`` variable. Default is 0.5
        id: Supply a layer id        
        num_neurons: Supply the output shape of the layer desired.
        verbose: As always

    """
    def __init__ (  self,                 
                    num_neurons,
                    id = -1,
                    distribution = 'binomial',
                    verbose = 2,
                    options = None):

        if verbose >=3:
            print "... Creating a " + distribution + "random layer of " + \
                                                                "output_shape " +  str(num_neurons)

        super(random_layer,self).__init__(id = id, type = 'random', verbose = verbose)
        rng = numpy.random
        srng = RandomStreams(rng.randint(1,2147462468), use_cuda=None)
         
        if isinstance(num_neurons, int):
            num_neurons = (num_neurons,)

        if distribution == 'binomial':<commit_msg>doc fix with random layer.<commit_after>from abstract import layer
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import theano
import numpy

class random_layer (layer):
    """
    This is a random generation layer. 

    Args: 
        num_neurons: List of the shapes of all inputs.
        distribution: ``'binomial'``, ``'uniform'``, ``'normal'`` ``'gaussian'``
        limits: tuple for uniform
        mu: mean for gaussian
        sigma: variance for gaussian
        p: if ``type`` is ``'binomial'`` supply a ``p`` variable. Default is 0.5
        id: Supply a layer id        
        num_neurons: Supply the output shape of the layer desired.
        verbose: As always

    """
    def __init__ (  self,                 
                    num_neurons,
                    id = -1,
                    distribution = 'binomial',
                    verbose = 2,
                    options = None):

        if verbose >=3:
            print "... Creating a " + distribution + "random layer of " + \
                                                                "output_shape " +  str(num_neurons)

        super(random_layer,self).__init__(id = id, type = 'random', verbose = verbose)
        rng = numpy.random
        srng = RandomStreams(rng.randint(1,2147462468), use_cuda=None)
         
        if isinstance(num_neurons, int):
            num_neurons = (num_neurons,)

        if distribution == 'binomial':
{'fraction_non_alphanumeric': 0.09716459197786999, 'fraction_numerical': 0.011065006915629323, 'mean_word_length': 1.7088014981273407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6473355', 'n_tokens_mistral': 839, 'n_tokens_neox': 762, 'n_words': 245}