Exemplo n.º 1
0
Arquivo: model.py Projeto: Ocxs/MUIR
    def init_embedding(self):
        self.user_embedding = var_init(
            'user_embedding', [self.n_users, self.emb_dim],
            tf.random_normal_initializer(mean=0.0, stddev=0.01))

        self.train_visual_embedding = tf.Variable(tf.constant(
            0.0, shape=[self.n_items + 1, 512]),
                                                  trainable=False,
                                                  name='train_visual_emb')

        self.item_category_embedding = var_init(
            'item_category_embedding', [self.n_cates, self.emb_dim],
            tf.random_normal_initializer(mean=0.0, stddev=0.01))
Exemplo n.º 2
0
    def init_embedding(self):
        self.user_embedding = var_init(
            'user_embedding', [self.n_users, self.emb_dim],
            tf.random_normal_initializer(mean=0.0, stddev=0.01))

        item_category_embedding = var_init(
            'item_category_embedding', [self.n_cates, self.emb_dim],
            tf.random_normal_initializer(mean=0.0, stddev=0.01))
        self.item_category_embedding = tf.concat(
            [item_category_embedding,
             tf.zeros((1, self.emb_dim))], axis=0)

        self.visual_feature = tf.Variable(tf.constant(
            0.0, shape=[self.n_items + 1, 4000]),
                                          trainable=False,
                                          name='visual_feat')
Exemplo n.º 3
0
 def init_embedding(self):
     category_embedding = var_init('category_embedding',
                                   [512, self.cate_dim],
                                   tf.random_normal_initializer())
     self.category_embedding = tf.concat(
         [category_embedding,
          tf.zeros((1, self.cate_dim))], axis=0)
     self.train_visual_emb = tf.Variable(tf.constant(0.0,
                                                     shape=[984984, 512]),
                                         trainable=False,
                                         name='train_visual_emb')