-
大小: 12KB文件类型: .zip金币: 1下载: 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基础知识及通讯协议
相关资源
- keepalived-1.2.24.tar.gz+memcached-1.4.33.tar.
- winhex11.2
- cifar10demo.zip
- libnids-1.24.rar
- telnet-server-1.2-134.22.x86_64
- Winpcap 开发包 4.1.2
- 14亿邮箱泄露密码明文信息TensorFlow数
- 在mnist数据集上训练神经网络(非CN
- zlib-1.2.11.tar
- tensorflow 量化demo
- plupload2.1.2 queue 美化版 仿城通网盘
- qt 5+vs2013 插件 qt-vs-addin-1.2.5
- apache-storm-1.2.2.tar.gz
- Maxwell 12 破解版
- 遥感影像场景识别tensorflow-CNN
- CKA v1.19真题 - 最新CKA1.20已发布.pdf
- WinPCK源代码 v1.20.7
- 软著60页代码整理生成工具V1.2
- 使用zlib-1.2.11编译后生成,32位的zli
- 新大陆sp610固件1.2.80.rar
- 完整用CNN(Tensorflow)完成文本分类的
- 《tensorflow实战》的源代码
- CryptoJS v3.1.2.zip
- 在github上面的一些关于深度学习的项
- discuz 超级工单系统 主程序1.2.1含手机
- jboss-3.2.1_tomcat-4.1.24.zip
- 卡尔曼率波kalman_intro_chinese_V1.2.pdf
- 鸢尾花 softmax tensorflow
- Tensorflow程序
- jbpm web流程设计器-jbpm4_free_v1.2cut 免费
评论
共有 条评论