![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tensorflow
文章平均质量分 68
Lithe_Wei
You can do everything well, just try and endeavor!
展开
-
完整神经网络样例程序(TensorFlow,加入偏置项和relu激活函数)(源码)
# coding=utf-8"""完整的神经网络解决二分类问题(加入偏置项和relu激活函数)"""import tensorflow as tffrom numpy.random import RandomState# 定义训练数据batch大小batch_size = 8# 定义神经网络的参数w1 = tf.Variable(tf.random_normal([2, 3], stddev=1,...原创 2018-03-14 17:30:12 · 2392 阅读 · 0 评论 -
Tensorflow损失函数简例(源码)
#coding=utf-8import tensorflow as tf#通过TensorFlow实现交叉熵#cross_entropy = -tf.reduce_mean(# y_ * tf.log(tf.clip_by_value(y, 1e-10, 1.0)))'''y_ 代表正确结果y 代表预测结果tf.clip_by_value 函数,可以将一个张量中的数值限制在一个范围内(避免出...原创 2018-03-17 12:29:51 · 1305 阅读 · 0 评论 -
Tensorflow常见问题(错误和问题)
1.使用包含会话的内容是出现一下提示,但程序能正常运行:2018-03-12 17:38:54.592310: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 ...原创 2018-03-12 18:02:25 · 1123 阅读 · 0 评论 -
完整神经网络样例程序(TensorFlow)(源码)
TensorFlow实战Google深度学习框架案例P61-P64源码如下:# coding=utf-8"""完整的神经网络解决二分类问题"""import tensorflow as tffrom numpy.random import RandomState# 定义训练数据batch大小batch_size = 8# 定义神经网络的参数w1 = tf.Variable(tf.random_no...转载 2018-03-13 11:05:11 · 942 阅读 · 0 评论 -
TensorFlow安装完成简单测试(源码)
#coding=utf-8#日志显示级别1,2,3对应所有(infowaringerror),waringerror,error#import os#os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'import tensorflow as tf#张量a=tf.constant([1.0,2.0,3.0],shape=[3],name='a')b=tf.constan...原创 2018-03-13 11:10:47 · 737 阅读 · 0 评论 -
Tensorflow-Session运用简单测试(源码)
#coding=utf-8#支持中文注释import osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'import tensorflow as tfa = tf.constant([1.0,2.0], name="a")b = tf.constant([2.0,3.0], name="b")result_add = tf.add(a,b, name="add")...原创 2018-03-13 11:14:14 · 404 阅读 · 0 评论 -
TensorFlow初始化变量、常量函数用例(源码)
#coding=utf-8import osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'import tensorflow as tfw1 = tf.Variable(tf.random_normal([2,3],stddev=1, seed=1))w2 = tf.Variable(tf.random_normal([3,1],stddev=1, seed=1)...原创 2018-03-13 11:16:08 · 586 阅读 · 0 评论