---恢复内容开始---

1、softmax函数

2、tensorflow实现例子

#!/usr/bin/env python
# -*- coding: utf-8 -*- import tensorflow as tf input_data = tf.Variable( [[0.2, 0.2, 0.2]] , dtype = tf.float32 )
output = tf.nn.softmax(input_data)
with tf.Session() as sess:
init = tf.initialize_all_variables()
sess.run(init)
print(sess.run(input_data))
print(sess.run(output))
print(sess.run(tf.shape(output)) )

输出为:

[[ 0.2 0.2 0.2]]
[[ 0.33333334 0.33333334 0.33333334]]
[1 3]

#!/usr/bin/env python
# -*- coding: utf-8 -*- import tensorflow as tf input_data = tf.Variable( [[0.2, 0.2, 0.2],[1,2,3]] , dtype = tf.float32 )
output = tf.nn.softmax(input_data)
with tf.Session() as sess:
init = tf.initialize_all_variables()
sess.run(init)
print(sess.run(input_data))
print(sess.run(output))
print(sess.run(tf.shape(output)) )

  

  输出为:

[[ 0.2 0.2 0.2]
[ 1. 2. 3. ]]
[[ 0.33333334 0.33333334 0.33333334]
[ 0.09003057 0.24472848 0.66524094]]
[2 3]

tensorflow softmax应用的更多相关文章

  1. 2.tensorflow——Softmax回归

    import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples. ...

  2. TensorFlow softmax的互熵损失

    函数:tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None) 功能:这个函数的作用是计算 logits 经 softmax ...

  3. TensorFlow构建卷积神经网络/模型保存与加载/正则化

    TensorFlow 官方文档:https://www.tensorflow.org/api_guides/python/math_ops # Arithmetic Operators import ...

  4. Softmax回归(使用tensorflow)

    # coding:utf8 import numpy as np import cPickle import os import tensorflow as tf class SoftMax: def ...

  5. TensorFlow 入门之手写识别(MNIST) softmax算法

    TensorFlow 入门之手写识别(MNIST) softmax算法 MNIST flyu6 softmax回归 softmax回归算法 TensorFlow实现softmax softmax回归算 ...

  6. 学习笔记TF024:TensorFlow实现Softmax Regression(回归)识别手写数字

    TensorFlow实现Softmax Regression(回归)识别手写数字.MNIST(Mixed National Institute of Standards and Technology ...

  7. TensorFlow MNIST(手写识别 softmax)实例运行

    TensorFlow MNIST(手写识别 softmax)实例运行 首先要有编译环境,并且已经正确的编译安装,关于环境配置参考:http://www.cnblogs.com/dyufei/p/802 ...

  8. TensorFlow实战之Softmax Regression识别手写数字

         关于本文说明,本人原博客地址位于http://blog.csdn.net/qq_37608890,本文来自笔者于2018年02月21日 23:10:04所撰写内容(http://blog.c ...

  9. 【TensorFlow篇】--Tensorflow框架实现SoftMax模型识别手写数字集

    一.前述 本文讲述用Tensorflow框架实现SoftMax模型识别手写数字集,来实现多分类. 同时对模型的保存和恢复做下示例. 二.具体原理 代码一:实现代码 #!/usr/bin/python ...

随机推荐

  1. dedecms列表页调用子栏目列表,织梦首页调用栏目的子栏目标签代码

    dedecms列表页调用子栏目列表,织梦首页调用栏目的子栏目标签代码. dedecms列表页调用子栏目列表标签: {dede:channelartlist type='sun' }<a href ...

  2. [Leetcode] Binary search--275 H-Index

    Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize ...

  3. 解决Linux下面Firefox无法播放mp3的问题

    之前一直使用kali linux ,上班屏蔽噪音都用网易音乐.既然没有Linux客户端,那就网页版吧.不得不说,网易音乐的网页版做的真心赞. 在Kali Linux下面使用Firefox听歌一直都很正 ...

  4. C#简单构架之EF进行读写分离+多数据库(Mysql/SqlService)

    最近因为项目需要,研究了下EF的读写分离,所以做了一个demo进行测试,下面是项目的结构 表现层view 主要提供Web.WebApi等表现层的解决方案 公共层public 主要提供项目公共类库,数据 ...

  5. Chapter 9:Noise-Estimation Algorithms

    作者:桂. 时间:2017-06-14  12:08:57 链接:http://www.cnblogs.com/xingshansi/p/6956556.html 主要是<Speech enha ...

  6. read命令读取用户输入

    read命令用于从终端或文件中读取用户输入,它读取整行输入,如果没有指定名称,读取的行被赋值给内部变量REPLY.read命令常用选项:-a,-p,-s,-t,-n 1.REPLY变量 $readhe ...

  7. NLTK学习笔记(八):文法--词关系研究的工具

    [TOC] 对于一门语言来说,一句话有无限可能.问题是我们只能通过有限的程序来分析结构和含义.尝试将"语言"理解为:仅仅是所有合乎文法的句子的大集合.在这个思路的基础上,类似于 w ...

  8. 论文笔记 Generative Face Completion

    这篇paper将巧妙地将四个loss函数结合在一起,其中每一个loss的功能不同.但这篇paper不够elegant的地方也是loss太多!在本文中,我采用散文的写作方法谈谈自己对这篇paper的理解 ...

  9. 日常API之百度翻译

    百度翻译是什么,可以吃吗?相信很多人都熟悉,它是我们生活中必不可少的一只东东. 但是,百度翻译开发平台只有每月只能翻译200万个字符,多出的要按照49.00/百万字符来算.对于我酱紫的乞丐程序员来说, ...

  10. [leetcode-582-Kill Process]

    Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each ...