我有一段代码试图将输出作为输入的维度,其中包含0或1而不是[0,1]的值。我试图获得二进制激活函数来评估二进制数据集。
Duration
但它会引发错误。你能找到错误吗?
x = tf.placeholder("float", [None, COLUMN])
Wh = tf.Variable(tf.random_normal([COLUMN, UNITS_OF_HIDDEN_LAYER], mean=0.0, stddev=0.05))
h = tf.nn.sigmoid(tf.matmul(x, Wh))
Wo = tf.Variable(tf.random_normal([UNITS_OF_HIDDEN_LAYER, COLUMN], mean=0.0, stddev=0.05))
is_greater = tf.greater(tf.matmul(h, Wo), 0)
y = tf.to_float(is_greater)
# Objective functions
y_ = tf.placeholder("float", [None, COLUMN])
cost = tf.reduce_sum(tf.square(y_ - y)) / BATCH_SIZE
lr = tf.placeholder(tf.float32)
eps = tf.placeholder(tf.float32)
delta = tf.placeholder(tf.float32)