tf.nn.softmax

作者: dopami | 来源:发表于2018-02-10 18:01 被阅读39次

关于softmax的详细说明,请看Softmax

通过Softmax回归,将logistic的预测二分类的概率的问题推广到了n分类的概率的问题。通过公式

可以看出当月分类的个数变为2时,Softmax回归又退化为logistic回归问题。

下面的几行代码说明一下用法

# -*- coding: utf-8 -*-

import tensorflow as tf

A = [1.0,2.0,3.0,4.0,5.0,6.0]

with tf.Session() as sess:

        print sess.run(tf.nn.softmax(A))

结果

[ 0.00426978  0.01160646  0.03154963  0.08576079  0.23312201  0.63369131]

相关文章

  • 20170829

    20170829 1.tensorflow logistic regression tf.nn.softmax: ...

  • tf.nn.softmax

    关于softmax的详细说明,请看Softmax。 通过Softmax回归,将logistic的预测二分类的概率的...

  • tf.nn.softmax

    def softmax(logits, axis=None, name=None, dim=None): This...

  • tensorflow函数学习

    标签(空格分隔): tensorflow 深度学习 一、一些函数 1 tf.nn.softmax 输入一个张量,默...

  • TensorFlow学习笔记1.9:tf.nn.softmax(

    Computes softmax activations. (deprecated arguments)计算sof...

网友评论

    本文标题:tf.nn.softmax

    本文链接:https://www.haomeiwen.com/subject/tdfhtftx.html