-
大小: 12KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-06-17
- 语言: 其他
- 标签: TensorFlow 1.2 CIFAR10
资源简介
TensorFlow1.2版本CIFAR10代码,之前网上的版本基本上都不能用了
MacOS升级TensorFlow1.2: pip install --upgrade tensorflow

代码片段和文件信息
# Copyright 2015 Google Inc. 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.
# ==============================================================================
“““Builds the CIFAR-10 network.
Summary of available functions:
# Compute input images and labels for training. If you would like to run
# evaluations use input() instead.
inputs labels = distorted_inputs()
# Compute inference on the model inputs to make a prediction.
predictions = inference(inputs)
# Compute the total loss of the prediction with respect to the labels.
loss = loss(predictions labels)
# Create a graph to run one step of training with respect to the loss.
train_op = train(loss global_step)
“““
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import re
import sys
import tarfile
import tensorflow.python.platform
from six.moves import urllib
import tensorflow as tf
import cifar10_input
FLAGS = tf.app.flags.FLAGS
# Basic model parameters.
tf.app.flags.DEFINE_integer(‘batch_size‘ 128
“““Number of images to process in a batch.“““)
tf.app.flags.DEFINE_string(‘data_dir‘ ‘/tmp/cifar10_data‘
“““Path to the CIFAR-10 data directory.“““)
# Global constants describing the CIFAR-10 data set.
IMAGE_SIZE = cifar10_input.IMAGE_SIZE
NUM_CLASSES = cifar10_input.NUM_CLASSES
NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = cifar10_input.NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN
NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = cifar10_input.NUM_EXAMPLES_PER_EPOCH_FOR_EVAL
# Constants describing the training process.
MOVING_AVERAGE_DECAY = 0.9999 # The decay to use for the moving average.
NUM_EPOCHS_PER_DECAY = 350.0 # Epochs after which learning rate decays.
LEARNING_RATE_DECAY_FACTOR = 0.1 # Learning rate decay factor.
INITIAL_LEARNING_RATE = 0.1 # Initial learning rate.
# If a model is trained with multiple GPU‘s prefix all Op names with tower_name
# to differentiate the operations. Note that this prefix is removed from the
# names of the summaries when visualizing a model.
TOWER_NAME = ‘tower‘
DATA_URL = ‘http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz‘
def _activation_summary(x):
“““Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measure the sparsity of activations.
Args:
x: Tensor
Returns:
nothing
“““
# Remove ‘tow
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13976 2017-06-16 13:42 cifar10.py
文件 5636 2017-06-16 11:11 cifar10_eval.py
文件 9239 2017-06-16 13:17 cifar10_input.py
文件 4623 2017-06-16 13:51 cifar10_train.py
- 上一篇:ssh框架增删改查+图片上传案例
- 下一篇:usb基础知识及通讯协议
相关资源
- jstl-api-1.2和jstl-impl-1.2
- wpe源码1.2
- zlib 最新 1.2.8 win32 win64 编译好的dll
- xlrd-1.2.0完整包
- Samsung三星R439-DS系列网卡驱动程序 v
- VisualSVN-VS2019-7.1.2破解版
- TensorFlow1.4 官方手册
- SVN1.8.11中文语言包 TortoiseSVN-1.8.11.26
- doneex xcell compiler 2.1.2.9绿色汉化版(
-
ST-li
nkv2、v2.1最新官方固件升级工具 - 一芯FC1178BC主控量产工具v1.01.29201610
- USB Type-C 规范1.2(中文版).pdf
- 最简单的基于FFmpeg的推流器 1.2
- 基于TP3.1.2的通用网站后台
- Safengine Shielden V2.1.2.0 简体中文免费版
- 淘宝注册软件|谷跑淘宝注册软件v1.
- 锤子Thor1.2+Thor1.34+300条过滤器规则
- MSCNN_dehaze.rar
- 基于双向LSTM+tensorflow中文分词
- CRT-591-Y 通讯协议_V1.2.doc
- 最简单的基于FFmpeg的编码器 1.2
- 最简单的基于FFMPEG的AVDevice的 1.2
- 开单大师学习版3.1.2房产软件 源码 房
- TortoiseSVN-1.10.1.28295-svn-1.10.2-32位-64位和
- TensorFlow Machine Learning Cookbook+无码高清
- Hands-On Machine Learning with Scikit-Learn an
- 1.25mm链接器AD封装
- TensorFlow 官方文档中文版高清无码PD
- lucene.net2.3.1.2盘古分词演示程序.rar
- NBT33008.1.2-2018电动汽车充电设备检验试
评论
共有 条评论