TensorFlow Variable, Placeholder 以及激励函数学习小结
来源:互联网 发布:入门c语言 编辑:程序博客网 时间:2024/06/06 07:36
TensorFlow Variable
#encoding=utf-8import tensorflow as tfstate = tf.Variable(0,name='counter') #初始值为0,名字叫counter#print(state.name)one = tf.constant(1)new_value = tf.add(state,one)update = tf.assign(state,new_value)# 如果定义 Variable, 就一定要 initializeinit = tf.global_variables_initializer() #初始化所有变量with tf.Session() as sess: sess.run(init) for _ in range(8): sess.run(update) print(sess.run(state))
结果:
TensorFlow Placeholder
#encoding=utf-8import tensorflow as tf#在 Tensorflow 中需要定义 placeholder 的 type ,一般为 float32 形式input1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1,input2)with tf.Session() as sess: #需要传入的值放在了feed_dict={} 并一一对应每一个 input. placeholder 与 feed_dict={} 是绑定在一起出现的。 print(sess.run(output,feed_dict={input1:[7.],input2:[3.]}))
结果
TensorFlow激励函数
激励函数运行时激活神经网络中某一部分神经元,将激活信息向后传入下一层的神经系统。激励函数的实质是非线性方程。 Tensorflow 的神经网络 里面处理较为复杂的问题时都会需要运用激励函数 activation function 。
莫烦的教程写的很好,在此附上链接https://morvanzhou.github.io/tutorials/machine-learning/ML-intro/3-04-activation-function/
参考
以上的内容是学习莫烦的教程得到的学习心得和记录,他的教程讲的非常用心且透彻,附上莫烦的链接,大家可以去学习https://morvanzhou.github.io/tutorials/machine-learning/
阅读全文
0 0
- TensorFlow Variable, Placeholder 以及激励函数学习小结
- tensorflow中Variable和Placeholder的学习
- TensorFlow Session&&Variable&&PlaceHolder
- tensorflow框架学习(一)placeholder 与variable
- TensorFlow 学习积累(1):variable 和 placeholder
- Tensorflow 的组件 placeholder,Variable
- tensorflow学习之常用函数总结:tensorflow.placeholder()函数
- TensorFlow 插曲-- tf.placeholder 与 tf.Variable
- 【Tensorflow】tf.placeholder函数
- Tensorflow tf.placeholder函数
- 【Tensorflow】tf.placeholder函数
- tensorflow学习:placeholder用法
- TensorFlow学习之 placeholder
- 莫烦学习笔记之TensorFlow(Activation function)激励函数
- Tensorflow 激励函数 Activation Function
- tensorflow 学习笔记3 placeholder与激活函数
- 3. Tensorflow学习笔记之tf.placeholder函数
- Tensorflow学习:Variable变量
- caffe中添加新层(差分层)
- hdu2897邂逅明下——博弈sg函数的应用
- Ajax基本应用---自动刷新页面
- HDU 4825 字典树
- Android studio配置郭神的LitePal问题解决方法
- TensorFlow Variable, Placeholder 以及激励函数学习小结
- 线程和进程
- 一大波智力题正在靠近~
- uva 12655 Trucks [LCA](树链剖分+MST)
- 字符串查找
- dfs+bfs Children of the Candy Corn
- 不会&还要学的知识点(近期目标?)
- HDU6058-Kanade's sum 链表+思维
- Codeforces Round #420 (Div. 2) E. Okabe and El Psy Kongroo dp+矩阵快速幂