tensorflow - 如何将 logits 转换为 tensorflow 中二元分类的概率?

标签 tensorflow deep-learning

logits= tf.matmul(inputs, weight) + bias

经过 matmul 运算后,logits 是从 MLP 层派生的两个值。
我的目标是二元分类,如何将两个值 logits 转换为概率,其中包括正概率和负概率,它们的总和为 1 ?

最佳答案

predictions = tf.nn.softmax(logits)

关于tensorflow - 如何将 logits 转换为 tensorflow 中二元分类的概率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46416984/

相关文章:

python - Pytorch:运行时错误:预期的 dtype Float 但得到了 dtype Long

matlab - 如何检查relu梯度

python - 我们可以使用一维卷积进行图像分类吗?

python-3.x - 如何继续用新的类和数据训练模型?

machine-learning - 尝试理解 Pytorch 的 LSTM 实现

python - IoU 在 python/caffe 中实现每个类的语义分割

deep-learning - 减少 fasttext bin 文件的大小

python - 如何在 keras 中包装 tensorflow RNNCell?

python - TensorFlow 数据集 API 中的 IDE 断点映射 py_function?

python - 如何在 TensorFlow 中使用 tf.nn.embedding_lookup_sparse?