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

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. Dede CMS如何在文章中增加“附件下载”操作说明

    1.进入后台--在"附件管理"中选择"上传新文件" 2.在"说明标题"输入要上传文件的名字,并在下面浏览找到要上传的文件,保存. 3.在&q ...

  2. 抓包工具-Wireshark(详细介绍与TCP三次握手数据分析)

    功能使用的详细介绍 wireshark(官方下载网站: http://www.wireshark.org/),是用来获取网络数据封包,可以截取各种网络封包,显示网络封包的详细信息,包括http,TCP ...

  3. JavaScript事件与例子

    事件,就是预先设置好的一段代码,等到用户触发的时候执行. 一:常见的事件: 1.关于鼠标的事件 onclick 鼠标单击触发 ondblclick 鼠标双击触发 onmouseover 鼠标移上触发 ...

  4. mysql基于binlog回滚工具_flashback(python版本)

        update.delete的条件写错甚至没有写,导致数据操作错误,需要恢复被误操作的行记录.这种情形,其实时有发生,可以选择用备份文件+binlog来恢复到测试环境,然后再做数据修复,但是这样 ...

  5. markdown基础

    介绍: markdown是一种可以使用普通文本编译器编写的标记语言,通过简单的标记语法,它可以使普通文本具有一定的格式.说的简单一点,markdown其实就是一种简单的文本,与普通的文本文件(txt文 ...

  6. JS面向对象笔记二

    菜单导航,<JS面向对象笔记一>,  参考书籍:阮一峰之<JavaScript标准参考教程> 一.构造函数和new命令 二.this关键字 三.构造函数和new命令 四.构造函 ...

  7. linux 升级yum对应的python

    这里记录一下linux 系统升级python对yum带来影响的解决办法 很多人在使用linux系统执行python任务的时候需要升级linux系统自带的python到高级版本.具体如何升级python ...

  8. Example012点击修改属性

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. 移动端布局,C3新增属性

    <html5拖拽> 1.给元素设置 draggable="true" 属性,这个元素就可以被拖拽了 <拖拽元素事件> 2.ondragstart 拖拽前触发 ...

  10. 不错的 HttpHelper类 c#

    /// <summary>/// 类说明:HttpHelper类,用来实现Http访问,Post或者Get方式的,直接访问,带Cookie的,带证书的等方式,可以设置代理/// 重要提示: ...