def linear_representation_graph(tf_features, n_components, n_features, node_name_ending):
# Create variable nodes
tf_linear_weights = tf.Variable(tf.random_normal([n_features, n_components], stddev=.5),
name='linear_weights_%s' % node_name_ending)
tf_repr = tf.sparse_tensor_dense_matmul(tf_features, tf_linear_weights)
# Return repr layer and variables
return tf_repr, [tf_linear_weights]
评论列表
文章目录