Exemple #1
0
    def __init__(self, *args):
        super(RNN, self).__init__(*args)

        self.h = utils.create_shared_variable(self.default_init,
                                              (1, self.num_hidden))
        self.x_to_h = utils.create_shared_variable(
            self.hidden_to_hidden_init, (self.num_input, self.num_hidden))
        self.h_to_h = utils.create_shared_variable(
            self.hidden_to_hidden_init, (self.num_hidden, self.num_hidden))
        self.b_h = utils.create_shared_variable(self.default_init,
                                                (self.num_hidden, ))
 def __init__(self, *args):
     super(RNN, self).__init__(*args)
     
     self.h = utils.create_shared_variable(self.default_init,
                                           (1, self.num_hidden))
     self.x_to_h = utils.create_shared_variable(self.hidden_to_hidden_init,
                                                (self.num_input,
                                                 self.num_hidden))
     self.h_to_h = utils.create_shared_variable(self.hidden_to_hidden_init,
                                                (self.num_hidden,
                                                 self.num_hidden))
     self.b_h = utils.create_shared_variable(self.default_init,
                                             (self.num_hidden,))
 def __init__(self,
              num_input,
              num_output,
              weight_init=lasagne.init.Orthogonal,
              bias_init=lasagne.init.Uniform):
     
     self.num_input = num_input
     self.num_output = num_output
     self.weight_init = weight_init
     self.bias_init = bias_init
     self.w = utils.create_shared_variable(self.weight_init,
                                           (self.num_input,
                                            self.num_output,))
     self.b = utils.create_shared_variable(self.bias_init,
                                           (self.num_output,))
 def __init__(self, *args):
     super(LSTM, self).__init__(*args)
     
     self.h = utils.create_shared_variable(self.default_init,
                                           (1, self.num_hidden))
     self.c = utils.create_shared_variable(self.default_init,
                                           (1, self.num_hidden))        
     self.x_to_inter = utils.create_shared_variable(self.hidden_to_hidden_init,
                                                    (self.num_input,
                                                     4*self.num_hidden,))
     self.h_to_inter = utils.create_shared_variable(self.hidden_to_hidden_init,
                                                    (self.num_hidden,
                                                     4*self.num_hidden,))
     self.b_inter = utils.create_shared_variable(self.default_init,
                                               (4*self.num_hidden,))
 def __init__(self,
              num_input,
              num_output,
              weight_init=lasagne.init.Orthogonal,
              bias_init=lasagne.init.Uniform):
     
     self.num_input = num_input
     self.num_output = num_output
     self.weight_init = weight_init
     self.bias_init = bias_init
     self.w = utils.create_shared_variable(self.weight_init,
                                           (self.num_input,
                                            self.num_output,))
     self.b = utils.create_shared_variable(self.bias_init,
                                           (self.num_output,))