tf.nn.softmax

tf.nn.softmax(logits, dim=-1, name=None)

Docstring:

Computes softmax activations (softmax可以直接看作成激活函数,得到属于各类别的概率)

Type: function

For each batch i and class j we have
softmax = exp(logits) / reduce_sum(exp(logits), dim)

Args:

logits: A non-empty Tensor. Must be one of the following types: half, float32, float64.
dim: The dimension softmax would be performed on. The default is -1 which indicates the last dimension.
name: A name for the operation (optional).

Returns:

A Tensor. Has the same type as logits. Same shape as logits.

Raises :

InvalidArgumentError: if logits is empty or dim is beyond the last dimension of logits.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容