'Initialize the parameters of the layer, either by using sparse
initialization or small isotropic noise.'

def _init_params(self):

    if self.rank_n_approx:
        W_em1 = self.init_fn(self.n_in, self.rank_n_approx, self.sparsity, self.scale, self.rng)
        W_em2 = self.init_fn(self.rank_n_approx, self.n_out, self.sparsity, self.scale, self.rng)
        self.W_em1 = theano.shared(W_em1, name=('W1_%s' % self.name))
        self.W_em2 = theano.shared(W_em2, name=('W2_%s' % self.name))
        self.b_em = theano.shared(self.bias_fn(self.n_out, self.bias_scale, self.rng), name=('b_%s' % self.name))
        self.params += [self.W_em1, self.W_em2, self.b_em]
        if self.weight_noise:
            self.nW_em1 = theano.shared((W_em1 * 0.0), name=('noise_W1_%s' % self.name))
            self.nW_em2 = theano.shared((W_em * 0.0), name=('noise_W2_%s' % self.name))
            self.nb_em = theano.shared((b_em * 0.0), name=('noise_b_%s' % self.name))
            self.noise_params = [self.nW_em1, self.nW_em2, self.nb_em]
            self.noise_params_shape_fn = [constant_shape(x.get_value().shape) for x in self.noise_params]
    else:
        W_em = self.init_fn(self.n_in, self.n_out, self.sparsity, self.scale, self.rng)
        self.W_em = theano.shared(W_em, name=('W_%s' % self.name))
        self.b_em = theano.shared(self.bias_fn(self.n_out, self.bias_scale, self.rng), name=('b_%s' % self.name))
        self.params += [self.W_em, self.b_em]
        if self.weight_noise:
            self.nW_em = theano.shared((W_em * 0.0), name=('noise_W_%s' % self.name))
            self.nb_em = theano.shared(numpy.zeros((self.n_out,), dtype=theano.config.floatX), name=('noise_b_%s' % self.name))
            self.noise_params = [self.nW_em, self.nb_em]
            self.noise_params_shape_fn = [constant_shape(x.get_value().shape) for x in self.noise_params]
    self.additional_weights = []
    self.noise_additional_weights = []
    if self.additional_inputs:
        for (pos, size) in enumerate(self.additional_inputs):
            W_add = self.init_fn(size, self.n_out, self.sparsity, self.scale, self.rng)
            self.additional_weights += [theano.shared(W_add, name=('W_add%d_%s' % (pos, self.name)))]
            if self.weight_noise:
                self.noise_additional_weights += [theano.shared((W_add * 0.0), name=('noise_W_add%d_%s' % (pos, self.name)))]
    self.params = (self.params + self.additional_weights)
    self.noise_params += self.noise_additional_weights
    self.noise_params_shape_fn += [constant_shape(x.get_value().shape) for x in self.noise_additional_weights]
    self.params_grad_scale = [self.grad_scale for x in self.params]
