Beispiel #1
0
    def _initialize_params(self):
        '''Initialize parameters in the layer'''

        with tf.variable_scope(self.scope_name) as sc:

            self.Wx = tf.get_variable("Wx", shape=[self.D, self.M], \
                    initializer=init_weights('xavier'))

            self.hbias = tf.get_variable("hbias", shape=[self.M], \
                    initializer=init_weights('zeros'))

            self.params = [self.Wx, self.hbias]
Beispiel #2
0
    def _initialize_params(self):
        '''Initialize parameters in the layer'''

        with tf.variable_scope(self.scope_name):

            self.Wx = tf.get_variable("Wx", shape=[self.D, self.M], \
                    initializer=init_weights('xavier'))

            hid2hid = [self.M, self.M]
            self.Wh = tf.get_variable("Wx", shape=hid2hid, \
                    initializer=init_weights('identity')(hid2hid))

            self.hbias = tf.get_variable("hbias", shape=[self.M], \
                    initialzer=init_weights('zeros'))

            self.params = [self.Wx, self.Wh, self.hbias]
Beispiel #3
0
    def _initialize_params(self):
        '''Initialize parameters in the layer'''

        with tf.variable_scope(self.scope_name) as sc:

            self.W_embed = tf.get_variable("W_embed", shape=[self.D, self.M], \
                    initializer=init_weights('xavier'))
            self.params = [self.W_embed]
Beispiel #4
0
    def _initialize_params(self):
        '''Initialize parameters in the layer'''

        with tf.variable_scope(self.scope_name):

            self.Wx_x = tf.get_variable("Wx_x", shape=[self.D, self.M * 3], \
                                initializer=init_weights('xavier'))

            self.Wx_O = tf.get_variable("Wx_O", shape=[self.M, self.M * 3], \
                                initializer=init_weights('xavier'))

            #self.Wx_y = tf.get_variable("Wx_y", shape=[self.M, self.M * 3], \
            #                    initializer=init_weights('xavier'))

            self.b_in = tf.Variable(tf.concat(0, [\
                                tf.zeros([self.M * 2,], tf.float32), \
                                tf.ones([self.M,], tf.float32)]), "b_in")


            self.WIN_O = tf.get_variable("WIN_O", shape=[self.D, self.M], \
                                initializer=init_weights('xavier'))

            self.WIN_y = tf.get_variable("WIN_y", shape=[self.M, self.M], \
                                initializer=init_weights('xavier'))

            self.b_IN = tf.get_variable("b_IN", shape=[self.M], \
                    initializer=init_weights('zeros'))

            self.init_O = tf.get_variable("init_O", shape=[1, self.M], \
                    initializer=init_weights('zeros'))

            self.init_y = tf.get_variable("init_y", shape=[1, self.M], \
                    initializer=init_weights('zeros'))

            self.params = [ self.Wx_x, self.Wx_O, \
                            self.WIN_O, self.WIN_y, self.b_in, self.b_IN]