【发布时间】:2018-11-28 03:58:01
【问题描述】:
我使用以下假设运行以下简单代码:
A值和B值相似,通过组合几个变量使B值等于A值。
所以我的假设是这样的
A = W1(weight)*B + W2(weight)C(anotehr varables)+...
这是我的尝试代码
hypothesis = tf.sigmoid(tf.matmul(X1, W1)+tf.matmul(X2, W2)+tf.matmul(X3, W3)+tf.matmul(X4, W4) + tf.matmul(X5, W5) + b1)
cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y) * tf.log(1 - hypothesis))
train = tf.train.GradientDescentOptimizer(learning_rate=0.000000000000000001).minimize(cost)
predicted = tf.cast(hypothesis > 0.5, dtype=tf.float32)
accuracy = tf.reduce_mean(tf.cast(tf.equal(predicted, Y), dtype=tf.float32))
with tf.Session() as sess:
# Initialize TensorFlow variables
sess.run(tf.global_variables_initializer())
for step in range(5000):
sess.run(y, feed_dict={X1:ct, X2: temperature, X3:humidity, X4: windspeed, X5:tideheight, Y:sst})
但是,当我验证这段代码的值时,我想出了一个根本不合适的值。
当我查看数据集时,它似乎不是线性的。
如果你能给我一个关于这种情况的例子,我将不胜感激。
我的数据集:
A B C D E F
25.6 27.29999 24.4752741667 71.5801495 6.468 97.1
25.6 27.5 24.3449186667 71.1314193333 5.39 288.3
25.4 27.60001 24.4019961667 71.8209758333 6.076 103.7
25.5 27.5 24.3473485 71.3570816667 6.762 95.3
25.5 27.5 24.3420308333 71.9577738333 5.978 103.7
25.6 27.29999 24.464413 71.993804 6.37 105.8
25.6 27.29999 24.3999401667 71.5558695 6.664 100.2
...
【问题讨论】:
-
在我们进入解决方案之前,我想要两件事,1. 你的矩阵。请张贴您的 DataFrame。 2.您确定要使用神经网络回归吗?
-
如果我使用神经网络回归,那么我可以检查权重值吗?如果可以,那也很好。
-
您正在使用神经网络。我正在考虑切换到不同的库。
标签: python tensorflow regression