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

def _init_params(self):

    self.W_ems = []
    self.b_ems = []
    if self.rank_n_approx:
        W_em1 = self.init_fn[0](self.n_in, self.rank_n_approx, self.sparsity[0], self.scale[0], self.rng)
        W_em2 = self.init_fn[0](self.rank_n_approx, self.n_hids[0], self.sparsity[0], self.scale[0], self.rng)
        self.W_em1 = theano.shared(W_em1, name=('W1_0_%s' % self.name))
        self.W_em2 = theano.shared(W_em2, name=('W2_0_%s' % self.name))
        self.W_ems = [self.W_em1, self.W_em2]
    else:
        W_em = self.init_fn[0](self.n_in, self.n_hids[0], self.sparsity[0], self.scale[0], self.rng)
        self.W_em = theano.shared(W_em, name=('W_0_%s' % self.name))
        self.W_ems = [self.W_em]
    self.b_em = theano.shared(self.bias_fn[0](self.n_hids[0], self.bias_scale[0], self.rng), name=('b_0_%s' % self.name))
    self.b_ems = [self.b_em]
    for dx in xrange(1, self.n_layers):
        W_em = self.init_fn[dx]((self.n_hids[(dx - 1)] / self.pieces[dx]), self.n_hids[dx], self.sparsity[dx], self.scale[dx], self.rng)
        W_em = theano.shared(W_em, name=('W_%d_%s' % (dx, self.name)))
        self.W_ems += [W_em]
        b_em = theano.shared(self.bias_fn[dx](self.n_hids[dx], self.bias_scale[dx], self.rng), name=('b_%d_%s' % (dx, self.name)))
        self.b_ems += [b_em]
    self.params = [x for x in self.W_ems]
    if (self.learn_bias and (self.learn_bias != 'last')):
        self.params = ([x for x in self.W_ems] + [x for x in self.b_ems])
    elif (self.learn_bias == 'last'):
        self.params = ([x for x in self.W_ems] + [x for x in self.b_ems][:(-1)])
    self.params_grad_scale = [self._grad_scale for x in self.params]
    if self.weight_noise:
        self.nW_ems = [theano.shared((x.get_value() * 0), name=('noise_' + x.name)) for x in self.W_ems]
        self.nb_ems = [theano.shared((x.get_value() * 0), name=('noise_' + x.name)) for x in self.b_ems]
        self.noise_params = ([x for x in self.nW_ems] + [x for x in self.nb_ems])
        self.noise_params_shape_fn = [constant_shape(x.get_value().shape) for x in self.noise_params]
