资源简介
1.TensorFlow安装、技巧、教材
2.TensorFlow官方文档
3.TensorFlow图像识别应用
4.深度学习基础教程
代码片段和文件信息
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
“““Simple end-to-end LeNet-5-like convolutional MNIST model example.
This should achieve a test error of 0.7%. Please keep this model as simple and
linear as possible it is meant as a tutorial for simple convolutional models.
Run with --self_test on the command line to execute a short self-test.
“““
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import sys
import time
import numpy
from six.moves import urllib
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
SOURCE_URL = ‘http://yann.lecun.com/exdb/mnist/‘
WORK_DIRECTORY = ‘data‘
IMAGE_SIZE = 28
NUM_CHANNELS = 1
PIXEL_DEPTH = 255
NUM_LABELS = 10
VALIDATION_SIZE = 5000 # Size of the validation set.
SEED = 66478 # Set to None for random seed.
BATCH_SIZE = 64
NUM_EPOCHS = 10
EVAL_BATCH_SIZE = 64
EVAL_FREQUENCY = 100 # Number of steps between evaluations.
tf.app.flags.DEFINE_boolean(“self_test“ False “True if running a self test.“)
tf.app.flags.DEFINE_boolean(‘use_fp16‘ False
“Use half floats instead of full floats if True.“)
FLAGS = tf.app.flags.FLAGS
def data_type():
“““Return the type of the activations weights and placeholder variables.“““
if FLAGS.use_fp16:
return tf.float16
else:
return tf.float32
def maybe_download(filename):
“““Download the data from Yann‘s website unless it‘s already here.“““
if not tf.gfile.Exists(WORK_DIRECTORY):
tf.gfile.MakeDirs(WORK_DIRECTORY)
filepath = os.path.join(WORK_DIRECTORY filename)
if not tf.gfile.Exists(filepath):
filepath _ = urllib.request.urlretrieve(SOURCE_URL + filename filepath)
with tf.gfile.GFile(filepath) as f:
size = f.size()
print(‘Successfully downloaded‘ filename size ‘bytes.‘)
return filepath
def extract_data(filename num_images):
“““Extract the images into a 4D tensor [image index y x channels].
Values are rescaled from [0 255] down to [-0.5 0.5].
“““
print(‘Extracting‘ filename)
with gzip.open(filename) as bytestream:
bytestream.read(16)
buf = bytestream.read(IMAGE_SIZE * IMAGE_SIZE * num_images * NUM_CHANNELS)
data = numpy.frombuffer(buf dtype=numpy.uint8).astype(numpy.float32)
data = (data - (PIXEL_DEPTH /
相关资源
- Tensorflow2.0 Transformer模型中英翻译.ra
- 吴恩达深度学习笔记(黄海广博士高
- Deep Reinforcement Learning
- 深度学习 Deep Learning book MIT Ian Goodfe
- 迁移学习相关最新SCI文献
- 深度学习方法及应用 完整目录版
- 2016年深度学习论文合集
- 2 纪荣嵘-紧致化计算机视觉分析系统
- Sanjeev Arora在ICML2018上关于深度学习理
- 卷积神经网络实现情感分类
- 分布式深度学习论文tensorflow的并行计
- 深度学习500问
- 吴恩达深度学习第五课序列模型作业
- TensorFlow机器学习项目实战.epub
- Tensorflow内核剖析 电子书
- DeepLearning关于稀疏自编码器的资料
- tensorflow车牌号码识别源码
- 《深度学习之TensorFlow:入门、原理与
- 脑机接口导论.zip
- 深度学习(AI圣经).pdf+源码.
- hands-on machine learning with scikit-learn an
- 深度学习.zip
- protobuf-2.6.0以及protoc.exe
- tensorflow lite 依赖包
- 深度学习Deep Learning英文原版高清.pd
- Deep Learning深度学习(Bengio等著)中英
- 吴恩达-深度学习-改善深层神经网络课
- AI圣经pdf高清
- tensorFlow keras 深度学习 人工智能实践
- 《动手学深度学习》(Dive into Deep L
评论
共有 条评论