资源简介
Alex在2012年提出的alexnet网络结构模型引爆了神经网络的应用热潮,并赢得了2012届图像识别大赛的冠军,使得CNN成为在图像分类上的核心算法模型。
代码片段和文件信息
from datetime import datetime
import math
import time
import tensorflow as tf
batch_size = 32
num_batches = 100
def print_activations(t):
print(t.op.name‘ ‘t.get_shape().as_list())
def inference(images):
parameters = []
with tf.name_scope (‘conv1‘) as scope: #卷积层1和池化层1
kernel = tf.Variable (tf.truncated_normal ([1111364]dtype = tf.float32stddev = 1e-1)name = ‘weights‘)
conv =tf.nn.conv2d(imageskernel[1441]padding = ‘SAME‘)
biases = tf.Variable (tf.constant(0.0shape = [64]dtype = tf.float32)trainable= Truename = ‘biases‘)
bias = tf.nn.bias_add(convbiases)
conv1=tf.nn.relu(biasname=scope)
print_activations(conv1)
parameters +=[kernelbiases]
lrn1=tf.nn.lrn(conv14bias=1.0alpha=0.001/9beta=0.75name=‘lrn1‘)#LRN层
pool1=tf.nn.max_pool (lrn1ksize=[1331]strides=[1221]padding=‘VALID‘name=‘pool1‘)
print_activations(pool1)
with tf.name_scope(‘conv2‘) as scope: #卷积层2和池化层2
kernel = tf.Variable(tf.truncated_normal([5 5 64 192] dtype=tf.float32 stddev=1e-1) name=‘weights‘)
conv = tf.nn.conv2d(pool1 kernel [1 1 1 1] padding=‘SAME‘)
biases = tf.Variable(tf.constant(0.0 shape=[192] dtype=tf.float32) trainable=Truename = ‘biases‘)
bias = tf.nn.bias_add(conv biases)
conv2 = tf.nn.relu(bias name=scope)
print_activations(conv2)
parameters += [kernel biases]
lrn2 = tf.nn.lrn(conv2 4 bias=1.0 alpha=0.001 / 9 beta=0.75 name=‘lrn2‘)
pool2 = tf.nn.max_pool(lrn2 ksize=[1 3 3 1] strides=[1 2 2 1] padding=‘VALID‘ name=‘pool2‘)
print_activations(pool2)
with tf.name_scope(‘conv3‘) as scope: #卷积层3
kernel = tf.Variable(tf.truncated_normal([33192384] dtype=tf.float32 stddev=1e-1) name=‘weights‘)
conv = tf.nn.conv2d(pool2 kernel [1 11 1] padding=‘SAME‘)
biases = tf.Variable(tf.constant(0.0 shape=[384] dtype=tf.float32) trainable=Truename = ‘biases‘)
bias = tf.nn.bias_add(conv biases)
conv3 = tf.nn.relu(bias name=scope)
print_activations(conv3)
with tf.name_scope(‘conv4‘) as scope: #卷积层4
kernel = tf.Variable(tf.truncated_normal([3 3 384256] dtype=tf.float32 stddev=1e-1) name=‘weights‘)
co
- 上一篇:树莓派巡线白线.py
- 下一篇:视杯分割增强数据
相关资源
- Deep Learning Cookbook_ practical recipes to g
- 深度学习视频中的行为识别
- deep learning with python 中文版
- 吴恩达深度学习超参数调制完整程序
- 深度学习入门 基于python理论与实现
- Python-基于深度学习的语音增强使用
- 《深度学习Deep Learning with Python 2017》
- 深度学习进阶:自然语言处理
- 基于深度学习堆栈自动编码器模型的
- 深度学习入门:基于python的理论与实
- 吴恩达深度学习1-21-31-42-1编程作业线
- 基于Python的深度学习
- 安全帽检测detect.7z
- deep_learning_with_python.pdf(Jason Brownlee)
- 人脸识别python代码187268
- Make Your Own Neural Network - 搭建自己的神
- BrownLee Better Deep Learning
- python 直方图规定化代码
- 简单粗暴 TensorFlow
- 5. 深度学习中的目标检测 python代码实
- 深度学习入门:基于Python的理论与实
- Deep Learning from Scratch中文名:深度学习
- Deep Learning for Natural Language Processing.
- 字符型图片数字验证码识别完整过程
- Python深度学习122512
- 基于Tensorflow的人脸识别源码
- 中文情感分析python程序
- 基于深度学习Superpoint 的Python图像全景
- 《深度学习入门:基于Python的理论与
- Machine Learning with Python Cookbook.pdf
评论
共有 条评论