
tensorflow
农夫山泉2号
关于交流可以发邮件:778961303@qq.com
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
tensorflow一些细节
设置GPU使用方式为按需分配 gpus=tf.config.experimental.list_physical_devices('GPU') if gpus: try:#设置GPU显存占用为按需分配 for gpu in gpus: tf.config.experimental.set_memory_growth(gpu,True) logical_gpus=tf.confi...原创 2019-11-25 15:06:59 · 461 阅读 · 0 评论 -
tensorflow100天-第4天:逻辑回归
代码 # coding:utf-8 # zhong import tensorflow as tf # Import MINST data from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) learni...原创 2018-12-27 00:40:31 · 271 阅读 · 0 评论 -
tensorflow100天—第5天:最近邻算法
python代码 import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('/tmp/data/', one_hot=True) xtrain, ytrain = mnist....原创 2018-12-27 20:20:10 · 365 阅读 · 0 评论 -
Tensorflow100天—打印常量
import tensorflow as tf hello = tf.constant('hello, chenjun!') sess = tf.Session() print(sess.run(hello)) >>>b'hello, chenjun!'原创 2018-12-24 19:28:56 · 515 阅读 · 0 评论 -
Tensorflow100天—第2天:基本运算\占位符
# 1. 使用占位符placeholder import tensorflow as tf a = tf.placeholder(tf.int16) b = tf.placeholder(tf.int16) add = tf.add(a,b) mul = tf.multiply(a,b) with tf.Session() as sess: print('addition with vari...原创 2018-12-24 20:17:37 · 395 阅读 · 0 评论 -
tensorflow100天-第3天:线性回归
tensorflow版 # tensorflow 实现线性回归 import tensorflow as tf import numpy as np import matplotlib.pyplot as plt # plt.ion() rng = np.random # 超参数 learning_rate = 0.01 traing_epochs = 1000 display_step = ...翻译 2018-12-25 23:58:42 · 284 阅读 · 0 评论 -
tensorflow交叉熵损失函数
在分类的时候,一般采用交叉熵损失函数,然而今天用tensorflow做分类的时候,发现采用tensorflow的自用函数,和自己写的,计算出来的结果不一样。 而且采用自己实现时,我出现了loss为nan的情况 # tensorflow自带 loss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(labels=y, logit...原创 2019-01-23 12:32:55 · 950 阅读 · 0 评论