-
大小: 19KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-06-16
- 语言: 其他
- 标签: CIFAR-10 demo tensorflow
资源简介
CIFAR-10 的一个demo,可以直接运行,里边有数据集,是一个进行10中类别的图片进行分类,准确率高达95.67%

代码片段和文件信息
# 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
from tensorflow.models.image.cifar10 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:
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1663 2017-10-17 22:51 BUILD
文件 14063 2017-10-17 22:50 cifar10.py
文件 5667 2017-10-17 22:50 cifar10_eval.py
文件 9289 2017-10-17 22:50 cifar10_input.py
文件 2334 2017-10-17 22:50 cifar10_input_test.py
文件 10891 2017-10-17 22:50 cifar10_multi_gpu_train.py
文件 4695 2017-10-17 22:50 cifar10_train.py
文件 419 2017-10-17 22:51 README.md
文件 961 2017-10-17 22:50 __init__.py
- 上一篇:110/6kV变电站电气部分的设计
- 下一篇:卷积编码译码程序代码
相关资源
- dubbo分布式tcc事务demo
- Apk加固Demo
- 易语言播放器组件无缝转换(Demo2.e)
- cc2541 BLE DEMO
- stm32f030 IAP Demo(原创)
- 代码客:G-TcpServer(IOCP) 1.0 正式版及
- CListCtrlExDemo.rar
- 易语言-海康威视SDK-DEMO
- ssm框架登录注册demo
- RK3399 DEMO官方原厂 PCB 原理图以及周边
- MQTT推送Demo
- 微信小程序驾照考试题库demo完整
- redisson的demo
- bootstrap demo 源码大全
- springboot+rabbitmq项目demo(亲测可正常运
- 美松打印机SDK MsPrintSDK-Demo-DLL-CShare-
- 基于pytorch的UNet_demo实现及训练自己的
- 百度API车牌识别DEMO.rar
- stm32f105-usart-DMA收发demo
- TensorFlow1.4 官方手册
- springboot+webflux+mongodb+freemarker
- springboot整合activiti完整demo
- RFID读写demo
- 以鼠标位置为中心的滑轮放大功能d
- 基于Zxing的二维码条形码扫描和生成
- 手机基站数据Demo
- iOS Swift简单Demo
- 海康摄像头+web3.0开发包SDK的demo
- 微信小程序开发视频+demo
- 海康SDK delphi demo
评论
共有 条评论