tensorflow抛出ValueError错误:不支持任何值

时间:2017-09-23 02:19:06

标签: python tensorflow activation-function

我有一段代码试图将输出作为输入的维度,其中包含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)

0 个答案:

没有答案