def __init__(self, input, input_units, output_units, activation): self.input = input self.activation = activation self.output_units = output_units scale = 1.0 / np.sqrt(input_units) initW = np.asarray(get_rng().uniform(low=-scale, high=scale, size=(input_units, output_units)), dtype=floatX) initb = np.asarray(get_rng().uniform(low=-scale, high=scale, size=(output_units,)), dtype=floatX) self.W = shared(initW) self.b = shared(initb)
def __init__(self, input, filter_shape, input_shape, activation, subsample=(1, 1)): self.input = input self.activation = activation self.subsample = subsample self.input_shape = input_shape self.filter_shape = filter_shape scale = 1.0 / np.sqrt(np.prod(input_shape[1:])) initW = np.asarray(get_rng().uniform(low=-scale, high=scale, size=filter_shape), dtype=floatX) initb = np.asarray(get_rng().uniform(low=-scale, high=scale, size=(filter_shape[0],)), dtype=floatX) self.W = shared(initW) self.b = shared(initb)