tensorflow学习笔记
GaoJieVery6
这个作者很懒,什么都没留下…
展开
-
乱七八糟的tf
1.tf.Variable()相关my_state = tf.Variable(0, name = "counter") #创建一个Op变量my_state,并初始化为0one = tf.constant(1) #创建一个Op常量赋值为1new_value = tf.add(my_state, one)update = tf.assign(my_state, new_value) ...原创 2019-08-23 21:52:21 · 191 阅读 · 1 评论 -
tensorflow实现去噪自编码器
import numpy as npimport tensorflow as tfimport matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_datamnist = input_data.read_data_sets('MNIST_data', validation_size...原创 2019-09-08 23:09:49 · 338 阅读 · 0 评论 -
RNN.LSTM异步预测股价
import pandas as pdimport numpy as npimport tensorflow as tfimport matplotlib.pyplot as plt%matplotlib inlinefrom sklearn.preprocessing import MinMaxScalerimport timedata = pd.read_csv('data_...原创 2019-09-04 22:14:13 · 350 阅读 · 1 评论 -
理解tf.nn.rnn_cell
一、学习单步的RNN:RNNCell如果要学习TensorFlow中的RNN,第一站应该就是去了解“RNNCell”,它是TensorFlow中实现RNN的基本单元,每个RNNCell都有一个call方法,使用方式是:(output, next_state) = call(input, state)。借助图片来说可能更容易理解。假设我们有一个初始状态h0,还有输入x1,调用call(x1,...原创 2019-09-01 22:56:20 · 2297 阅读 · 1 评论 -
tensorboard数据可视化
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport warningswarnings.filterwarnings("ignore")summary_dir = "/path/to/sd/sd1"batch_size = 100train_steps = 10...原创 2019-09-01 12:22:22 · 118 阅读 · 0 评论 -
利用tensorflow实现的类LeNet-5模型识别mnist
1.用到的部分函数tf.nn.conv2d (input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None)input : 输入的要做卷积的图片,要求为一个张量,shape为 [ batch, in_height, in_weight, in_channel ],其中batch为图片的...原创 2019-08-30 22:11:31 · 250 阅读 · 0 评论 -
识别MNIST
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_datainput_node = 784output_node = 10layer1_node = 500batch_size = 100learning_rate_base = 0.8learning_rate_decay =...原创 2019-08-22 09:43:19 · 159 阅读 · 0 评论 -
tf.train.ExponentialMovingAverage()
import tensorflow as tfv1 = tf.Variable(0, dtype=tf.float32)step = tf.Variable(0, trainable=False)ema = tf.train.ExponentialMovingAverage(0.99, step)maintain_averages_op = ema.apply([v1])#The ap...原创 2019-08-20 23:55:20 · 217 阅读 · 0 评论 -
tensorflow识别mnist的最佳样例程序
1.mnist_inferenceimport tensorflow as tfinput_node = 784output_node = 10layer1_node = 500def get_weight_variable(shape, regularizer) : weights = tf.get_variable("weights", shape, ...原创 2019-08-24 09:30:08 · 253 阅读 · 0 评论 -
部分tensorflow函数
1. tf.layers.conv2dconv2d(inputs, filters, kernel_size, strides=(1, 1), padding='valid', data_format='channels_last', dilation_rate=(1, 1), activation=None, use_bias=True, kernel_initi...原创 2019-09-08 23:10:36 · 227 阅读 · 0 评论