-
-
Save zhpmatrix/adde9a31eb21a1fdb25f19854aaf9730 to your computer and use it in GitHub Desktop.
代码笔记
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
返回Logistic Regression中的预测错误的样本: | |
float(sum( labels != (preds > 0.0) ) ) / len(labels) | |
核心逻辑:对于Sigmoid函数,y = 1 / 1 + exp(-x),当x > 0 时,y = 1, 当 x < 0 时, y = 0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sess资源释放
sess = tf.Session()
result = sess.run(product)
sess.close()
当使用with结构的时候,不需要显式的资源释放。
with tf.Session() as sess:
result = sess.run(product)
print(result)