【发布时间】:2019-03-12 04:49:02
【问题描述】:
输出层代码:
Weights1 = tf.Variable(tf.random_normal([11, 4]))
biases1 = tf.Variable(tf.zeros([1, 4]) + 0.1)
Wx_plus_b1 = tf.matmul(l0, Weights1) + biases1
N1act = 2/(1+pow(math.e,-Wx_plus_b1[3]))-1
我想使用第四个节点的输出
这是我自定义的激活函数,它只需要一个输入。
prediction = tf_spiky(N1act)
错误信息:
引发 ValueError(err.message)
ValueError: 维度 0 的切片索引 3 超出范围。为了 'strided_slice' (op: 'StridedSlice') 输入形状:[1,4], [1], [1], [1] 和计算输入张量: input[1] = , input[2] = , 输入[3] = .
【问题讨论】:
标签: python tensorflow