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_normal([self.feature_size, 1], 0.0, 1.0), name='feature_bias')
    if self.use_inner:
        weights['product-quadratic-inner'] = tf.Variable(tf.random_normal([self.deep_init_size, self.field_size], 0.0, 0.01))
    else:
        weights['product-quadratic-outer'] = tf.Variable(tf.random_normal([self.deep_init_size, self.embedding_size, self.embedding_size], 0.0, 0.01))
    weights['product-linear'] = tf.Variable(tf.random_normal([self.deep_init_size, self.field_size, self.embedding_size], 0.0, 0.01))
    weights['product-bias'] = tf.Variable(tf.random_normal([self.deep_init_size], 0, 0, 1.0))
    num_layer = len(self.deep_layers)
    input_size = self.deep_init_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)
    glorot = np.sqrt((2.0 / (input_size + 1)))
    weights['output'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(self.deep_layers[(- 1)], 1)), dtype=np.float32)
    weights['output_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_normal([self.feature_size, 1], 0.0, 1.0), name='feature_bias')
    if self.use_inner:
        weights['product-quadratic-inner'] = tf.Variable(tf.random_normal([self.deep_init_size, self.field_size], 0.0, 0.01))
    else:
        weights['product-quadratic-outer'] = tf.Variable(tf.random_normal([self.deep_init_size, self.embedding_size, self.embedding_size], 0.0, 0.01))
    weights['product-linear'] = tf.Variable(tf.random_normal([self.deep_init_size, self.field_size, self.embedding_size], 0.0, 0.01))
    weights['product-bias'] = tf.Variable(tf.random_normal([self.deep_init_size], 0, 0, 1.0))
    num_layer = len(self.deep_layers)
    input_size = self.deep_init_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)
    glorot = np.sqrt((2.0 / (input_size + 1)))
    weights['output'] = tf.Variable(np.random.normal(loc=0, scale=glorot, size=(self.deep_layers[(- 1)], 1)), dtype=np.float32)
    weights['output_bias'] = tf.Variable(tf.constant(0.01), dtype=np.float32)
    return weights