<gh_stars>10-100
"""

    Contains code for defining the dropout layer (currently unused).

"""
import theano.tensor as tensor


def dropout_layer(state_before, use_noise, trng):
    proj = tensor.switch(use_noise,
                         (state_before *
                          trng.binomial(state_before.shape,
                                        p=0.5, n=1,
                                        dtype=state_before.dtype)),
                         state_before * 0.5)
    return proj

"""

    Contains code for defining the dropout layer (currently unused).

"""
import theano.tensor as tensor


def dropout_layer(state_before, use_noise, trng):
    proj = tensor.switch(use_noise,
                         (state_before *
                          trng.binomial(state_before.shape,
                                        p=0.5, n=1,
                                        dtype=state_before.dtype)),
                         state_before * 0.5)
    return proj
Contains code for defining the dropout layer (currently unused).