![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow代码
户建坤 I Russell
这个作者很懒,什么都没留下…
展开
-
二次函数用dnn拟合, Matplotlib.pyplot 可视化,6种optmizer, varibal_scop, tensorboar
二次函数用dnn拟合, Matplotlib.pyplot 可视化,6种optmizer, varibal_scop, tensorboardimport tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltdef add_layer(input, in_size, out_size, activation=N...原创 2019-03-20 20:54:40 · 381 阅读 · 0 评论 -
2层DNN,Mnist的使用,交叉熵(cross_entropy)log + 1e-6, test集算accuracy用tf代码归为网络一部分
2层DNN,Mnist的使用,交叉熵(cross_entropy)log + 1e-6, test集算accuracy用tf代码归为网络一部分import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_datamnist = input_data.read_data_sets('MNIST_dat...原创 2019-03-21 18:20:37 · 228 阅读 · 0 评论 -
dynamic_rnn使用lstmcell,取时间最后一帧的方法不确定,tf.equel判断tensor是否相等,可以调bug用。这个代码比教程收敛快,可能有些问题,但没发现。
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport os#hyper_parametermax_train_step = 10000lr = 0.001batch_size = 32time_size = 28unit = 28class_size = 1...原创 2019-03-25 17:39:52 · 250 阅读 · 0 评论 -
tensorflow基础模板
import tensorflow as tfimport numpy as npimport os#hyper parametersbatch_size = 32save_path = 'model'max_train_step = 10000lr = 0.001#network structureclass nn(object): def __init__(sel...原创 2019-03-25 18:29:40 · 281 阅读 · 0 评论 -
train和test同时纯在,test用train的变量,train=False,reuse=True,summary变量时只调用trainModel的summary函数,Writer用两个分别写
train和test同时纯在,test用train的变量,train=False,reuse=True,summary变量时只调用trainModel的summary函数,Writer用两个分别写import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_datamnist = input_dat...原创 2019-03-22 11:56:04 · 1318 阅读 · 0 评论 -
cnn+pooling, save and restore, 第一次结构比较完整的代码
cnn+pooling, save and restore, 第一次结构比较完整的代码import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport os#hyper parameterssave_path = 'model'max_globel_step = 1000...原创 2019-03-23 13:53:25 · 130 阅读 · 0 评论 -
lstm+dynamic.rnn进行sin到cos的序列预测,画图有点不对,loss函数用的简单的l1,没用tracy。
import tensorflow as tfimport numpy as npimport osimport matplotlib.pyplot as plt#hyper parametersbatch_size = 50save_path = 'sin_cos_model'max_train_step = 10000lr = 0.001time_step = 20uni...原创 2019-03-27 18:09:35 · 286 阅读 · 0 评论 -
encoder+decoder+show输入和输出的图片+encoder之后的向量分类
encoder+decoder+show输入和输出的图片+encoder之后的向量分类import tensorflow as tfimport numpy as npimport osimport matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_datamnist = inp...原创 2019-04-11 11:25:01 · 824 阅读 · 0 评论