def _initialize_weights(self):
    weights = dict()
    weights['feature_embeddings'] = tf.Variable(tf.random.normal([self.feature_size, self.embedding_size], 0.0, 0.01), name='feature_embeddings')
    weights['feature_bias'] = tf.Variable(tf.random.uniform([self.feature_size, 1], 0.0, 1.0), name='feature_bias')
    num_layer = len(self.deep_layers)
    input_size = (self.field_size * self.embedding_size)
    glorot = np.sqrt((2.0 / (input_size + self.deep_layers[0])))
    weights['layer_0'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(input_size, self.deep_layers[0])), dtype=np.float32)
    weights['bias_0'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(1, self.deep_layers[0])), dtype=np.float32)
    for i in range(1, num_layer):
        glorot = np.sqrt((2.0 / (self.deep_layers[(i - 1)] + self.deep_layers[i])))
        weights[('layer_%d' % i)] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(self.deep_layers[(i - 1)], self.deep_layers[i])), dtype=np.float32)
        weights[('bias_%d' % i)] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(1, self.deep_layers[i])), dtype=np.float32)
    if (self.use_fm and self.use_deep):
        input_size = ((self.field_size + self.embedding_size) + self.deep_layers[(- 1)])
    elif self.use_fm:
        input_size = (self.field_size + self.embedding_size)
    elif self.use_deep:
        input_size = self.deep_layers[(- 1)]
    glorot = np.sqrt((2.0 / (input_size + 1)))
    weights['concat_projection'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(input_size, 1)), dtype=np.float32)
    weights['concat_bias'] = tf.Variable(tf.constant(0.01), dtype=np.float32)
    return weights
def _initialize_weights(self):
    weights = dict()
    weights['feature_embeddings'] = tf.Variable(tf.random.normal([self.feature_size, self.embedding_size], 0.0, 0.01), name='feature_embeddings')
    weights['feature_bias'] = tf.Variable(tf.random.uniform([self.feature_size, 1], 0.0, 1.0), name='feature_bias')
    num_layer = len(self.deep_layers)
    input_size = (self.field_size * self.embedding_size)
    glorot = np.sqrt((2.0 / (input_size + self.deep_layers[0])))
    weights['layer_0'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(input_size, self.deep_layers[0])), dtype=np.float32)
    weights['bias_0'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(1, self.deep_layers[0])), dtype=np.float32)
    for i in range(1, num_layer):
        glorot = np.sqrt((2.0 / (self.deep_layers[(i - 1)] + self.deep_layers[i])))
        weights[('layer_%d' % i)] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(self.deep_layers[(i - 1)], self.deep_layers[i])), dtype=np.float32)
        weights[('bias_%d' % i)] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(1, self.deep_layers[i])), dtype=np.float32)
    if (self.use_fm and self.use_deep):
        input_size = ((self.field_size + self.embedding_size) + self.deep_layers[(- 1)])
    elif self.use_fm:
        input_size = (self.field_size + self.embedding_size)
    elif self.use_deep:
        input_size = self.deep_layers[(- 1)]
    glorot = np.sqrt((2.0 / (input_size + 1)))
    weights['concat_projection'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(input_size, 1)), dtype=np.float32)
    weights['concat_bias'] = tf.Variable(tf.constant(0.01), dtype=np.float32)
    return weights