tensorflow softmax应用
---恢复内容开始---
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应用的更多相关文章
- 2.tensorflow——Softmax回归
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples. ...
- TensorFlow softmax的互熵损失
函数:tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None) 功能:这个函数的作用是计算 logits 经 softmax ...
- TensorFlow构建卷积神经网络/模型保存与加载/正则化
TensorFlow 官方文档:https://www.tensorflow.org/api_guides/python/math_ops # Arithmetic Operators import ...
- Softmax回归(使用tensorflow)
# coding:utf8 import numpy as np import cPickle import os import tensorflow as tf class SoftMax: def ...
- TensorFlow 入门之手写识别(MNIST) softmax算法
TensorFlow 入门之手写识别(MNIST) softmax算法 MNIST flyu6 softmax回归 softmax回归算法 TensorFlow实现softmax softmax回归算 ...
- 学习笔记TF024:TensorFlow实现Softmax Regression(回归)识别手写数字
TensorFlow实现Softmax Regression(回归)识别手写数字.MNIST(Mixed National Institute of Standards and Technology ...
- TensorFlow MNIST(手写识别 softmax)实例运行
TensorFlow MNIST(手写识别 softmax)实例运行 首先要有编译环境,并且已经正确的编译安装,关于环境配置参考:http://www.cnblogs.com/dyufei/p/802 ...
- TensorFlow实战之Softmax Regression识别手写数字
关于本文说明,本人原博客地址位于http://blog.csdn.net/qq_37608890,本文来自笔者于2018年02月21日 23:10:04所撰写内容(http://blog.c ...
- 【TensorFlow篇】--Tensorflow框架实现SoftMax模型识别手写数字集
一.前述 本文讲述用Tensorflow框架实现SoftMax模型识别手写数字集,来实现多分类. 同时对模型的保存和恢复做下示例. 二.具体原理 代码一:实现代码 #!/usr/bin/python ...
随机推荐
- cas单点登录系统:客户端(client)详细配置
最近一直在研究cas登录中心这一块的应用,分享一下记录的一些笔记和心得.后面会把cas-server端的配置和重构,另外还有这几天再搞nginx+cas的https反向代理配置,以及cas的证书相关的 ...
- android消息推送(Jpush)
一.我采用极光推送Jpush进行消息推送,完成一定时间给应用发送消息 二.开发步骤 1.下载Jpush的SDK 2.注册用户和应用,获取APPKey和 Master Secret 3-1.将SDK的l ...
- Behavior的使用(一):页面跳转NavigateToPageAction
Behavior的使用,让UI设计师能够更加方便的进行UI设计,更高效地和开发进行合作.Behavior有三种触发方式:EventTriggerBehavior事件触发,DataTriggerBeha ...
- 多线程并发执行任务,取结果归集。终极总结:Future、FutureTask、CompletionService、CompletableFuture
目录 1.Futrue 2.FutureTask 3.CompletionService 4.CompletableFuture 5.总结 ================正文分割线========= ...
- ionic结合HTML5实现打电话功能
HTML5中这样子可以实现打电话的功能,但是在ionic实际项目中,并不是直接就可以这样子用,需要配置一下config.xml文件就可以在手机上调用到自己的联系人打电话页面了, 因为项目是引用的Cor ...
- qt中setStyleSheet导致的内存泄漏
原始日期: 2017-01-05 19:31 现象:程序运行至某一个界面下,内存出现缓慢持续的占用内存增长 原因:经过排查,确定是在事件派发的槽函数中频繁重复调用setStyleSheet导致的 ...
- 论文笔记 Generative Face Completion
这篇paper将巧妙地将四个loss函数结合在一起,其中每一个loss的功能不同.但这篇paper不够elegant的地方也是loss太多!在本文中,我采用散文的写作方法谈谈自己对这篇paper的理解 ...
- Spring两种代理区别
Spring的两种代理JDK和CGLIB的区别浅谈: Java动态代理是利用反射机制生成一个实现代理接口的匿名类,在调用具体方法前调用invokeHandler类来处理: 而cglib动态代理是利用a ...
- 用mybatis实现dao的编写或者实现mapper代理
一.mybatis和hibernate的区别和应用场景hibernate:是一个标准的ORM框架(对象关系映射).入门门槛较高的,不需要写sql,sql语句自动生成了.对sql语句进行优化.修改比较困 ...
- [leetcode-553-Optimal Division]
Given a list of positive integers, the adjacent integers will perform the float division. For exampl ...