吴裕雄--天生自然深度学习TensorBoard可视化:projector_MNIST
摘要:import os import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from tensorflow.contrib.tensorboard.plugins import projector INPUT_NODE = 784 OUTPUT_NODE = 10 LAYER1_NODE
阅读全文
吴裕雄--天生自然深度学习TensorBoard可视化:projector_data_prepare
摘要:import os import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data %matplotlib inline LOG_DIR = 'F:\\temp\\log\\' SPRITE_FI
阅读全文
吴裕雄--天生自然深度学习TensorBoard可视化:监控指标可视化
摘要:import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 1. 生成变量监控信息并定义生成监控信息日志的操作。 SUMMARY_DIR = "F:\\temp\\log" BATCH_SIZE = 100 TRAIN_STEPS = 3000 def variable_summaries
阅读全文
吴裕雄--天生自然深度学习TensorBoard可视化:改造后的mnist_train
摘要:import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data INPUT_NODE = 784 OUTPUT_NODE = 10 LAYER1_NODE = 500 def get_weight_variable(shape, regularizer): weights = tf.get_var
阅读全文
吴裕雄--天生自然深度学习TensorBoard可视化:命名空间
摘要:# 1. 不同的命名空间。 import tensorflow as tf with tf.variable_scope("foo"): a = tf.get_variable("bar", [1]) print(a.name) with tf.variable_scope("bar"): b = tf.get_variable("bar", [1]) pri...
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Estimator-自定义模型
摘要:# 1. 自定义模型并训练。 import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data tf.logging.set_verbosity(tf.logging.INFO) def lenet(x, is_training): x = tf.reshape
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Estimator-DNNClassifier
摘要:# 1. 模型定义。 import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data tf.logging.set_verbosity(tf.logging.INFO) mnist = input_data.read_data_sets("F:\\Tensor
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Keras-TensorFlow API
摘要:# 1. 模型定义。 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist_data = input_data.read_data_sets('F:\\TensorFlowGoogle\\201806-github\\datasets\\MNIST_data', one_...
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Keras-多输入输出
摘要:# 1. 数据预处理。 import keras from keras.models import Model from keras.datasets import mnist from keras.layers import Input, Dense from tflearn.layers.core import fully_connected num_classes = 10 img_ro...
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Keras-返回值
摘要:# 1. 数据预处理。 import keras from keras.models import Model from keras.datasets import mnist from keras.layers import Input, Dense from tflearn.layers.core import fully_connected num_classes = 10 img_ro...
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Keras-RNN
摘要:# 1. 数据预处理。 from keras.layers import LSTM from keras.datasets import imdb from keras.models import Sequential from keras.preprocessing import sequence from keras.layers import Dense, Embedding max_fea
阅读全文
吴裕雄--天生自然TensorFlow高层封装:Keras-CNN
摘要:# 1. 数据预处理 import keras from keras import backend as K from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D num_classes =
阅读全文
吴裕雄--天生自然python Google深度学习框架:Tensorflow实现迁移学习
摘要:import glob import os.path import numpy as np import tensorflow as tf from tensorflow.python.platform import gfile import tensorflow.contrib.slim as slim # 加载通过TensorFlow-Slim定义好的inception_v3模型。 impor
阅读全文
吴裕雄--天生自然python Google深度学习框架:经典卷积神经网络模型
摘要:import tensorflow as tf INPUT_NODE = 784 OUTPUT_NODE = 10 IMAGE_SIZE = 28 NUM_CHANNELS = 1 NUM_LABELS = 10 CONV1_DEEP = 32 CONV1_SIZE = 5 CONV2_DEEP = 64 CONV2_SIZE = 5 FC_SIZE = 512 def inference(inp
阅读全文
吴裕雄--天生自然python Google深度学习框架:MNIST数字识别问题
摘要:import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data INPUT_NODE = 784 # 输入节点 OUTPUT_NODE = 10 # 输出节点 LAYER1_NODE = 500 # 隐藏层数 BATCH_SIZE = 100 # 每次batch打包的样本个数 # 模型相关的参数
阅读全文
吴裕雄--天生自然python Google深度学习框架:Tensorflow基础应用
摘要:import tensorflow as tf a = tf.constant([1.0, 2.0], name="a") b = tf.constant([2.0, 3.0], name="b") result = a + b print(result) import...
阅读全文