-
大小: 4.64MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-11-18
- 语言: Python
- 标签:
资源简介
Keras实现Inception-v4, Inception - Resnet-v1和v2网络架构
代码片段和文件信息
from keras.layers import Input merge Dropout Dense Lambda Flatten Activation
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import MaxPooling2D Convolution2D AveragePooling2D
from keras.models import Model
from keras import backend as K
import warnings
warnings.filterwarnings(‘ignore‘)
“““
Implementation of Inception-Residual Network v1 [Inception Network v4 Paper](http://arxiv.org/pdf/1602.07261v1.pdf) in Keras.
Some additional details:
[1] Each of the A B and C blocks have a ‘scale_residual‘ parameter.
The scale residual parameter is according to the paper. It is however turned OFF by default.
Simply setting ‘scale=True‘ in the create_inception_resnet_v1() method will add scaling.
“““
def inception_resnet_stem(input):
if K.image_dim_ordering() == “th“:
channel_axis = 1
else:
channel_axis = -1
# Input Shape is 299 x 299 x 3 (tf) or 3 x 299 x 299 (th)
c = Convolution2D(32 3 3 activation=‘relu‘ subsample=(2 2))(input)
c = Convolution2D(32 3 3 activation=‘relu‘ )(c)
c = Convolution2D(64 3 3 activation=‘relu‘ )(c)
c = MaxPooling2D((3 3) strides=(2 2))(c)
c = Convolution2D(80 1 1 activation=‘relu‘ border_mode=‘same‘)(c)
c = Convolution2D(192 3 3 activation=‘relu‘)(c)
c = Convolution2D(256 3 3 activation=‘relu‘ subsample=(22) border_mode=‘same‘)(c)
b = BatchNormalization(axis=channel_axis)(c)
b = Activation(‘relu‘)(b)
return b
def inception_resnet_A(input scale_residual=True):
if K.image_dim_ordering() == “th“:
channel_axis = 1
else:
channel_axis = -1
# Input is relu activation
init = input
ir1 = Convolution2D(32 1 1 activation=‘relu‘ border_mode=‘same‘)(input)
ir2 = Convolution2D(32 1 1 activation=‘relu‘ border_mode=‘same‘)(input)
ir2 = Convolution2D(32 3 3 activation=‘relu‘ border_mode=‘same‘)(ir2)
ir3 = Convolution2D(32 1 1 activation=‘relu‘ border_mode=‘same‘)(input)
ir3 = Convolution2D(32 3 3 activation=‘relu‘ border_mode=‘same‘)(ir3)
ir3 = Convolution2D(32 3 3 activation=‘relu‘ border_mode=‘same‘)(ir3)
ir_merge = merge([ir1 ir2 ir3] concat_axis=channel_axis mode=‘concat‘)
ir_conv = Convolution2D(256 1 1 activation=‘linear‘ border_mode=‘same‘)(ir_merge)
if scale_residual: ir_conv = Lambda(lambda x: x * 0.1)(ir_conv)
out = merge([init ir_conv] mode=‘sum‘)
out = BatchNormalization(axis=channel_axis)(out)
out = Activation(“relu“)(out)
return out
def inception_resnet_B(input scale_residual=True):
if K.image_dim_ordering() == “th“:
channel_axis = 1
else:
channel_axis = -1
# Input is relu activation
init = input
ir1 = Convolution2D(128 1 1 activation=‘relu‘ border_mode=‘same‘)(input)
ir2 = Convolution2D(128 1 1 activation=‘relu‘ border_mode=‘same‘)(input)
ir2 = Convolution2D(128 1 7 activation=‘relu‘ borde
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\
目录 0 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\.idea\
目录 0 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\.idea\inspectionProfiles\
文件 706 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\.idea\inspectionProfiles\Project_Default.xm
文件 235 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\.idea\inspectionProfiles\profiles_settings.xm
文件 180 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\.idea\vcs.xm
目录 0 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\Architectures\
文件 2355618 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\Architectures\Inception ResNet-v1.png
文件 2137294 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\Architectures\Inception ResNet-v2.png
文件 1798247 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\Architectures\Inception-v4.png
文件 2519 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\README.md
文件 7833 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\inception_resnet_v1.py
文件 9308 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\inception_resnet_v2.py
文件 6714 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\inception_v4.py
目录 0 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\weights\
文件 334 2017-02-03 06:35 titu1994-Inception-v4-af62d6f\weights\ADD_WEIGHT_FILES_HERE.txt
相关资源
- Python-基于tensorflow实现的用textcnn方法
- Python-pytorch中文手册
- Python-FastSCNN的PyTorch实现快速语义分割
- Python-滑动窗口高分辨率显微镜图像分
- Python-使用MovieLens数据集训练的电影推
- Python-机器学习驱动的Web应用程序防火
- Python-subpixel利用Tensorflow的一个子像素
-
Python-汉字的神经风格转移Neuralst
y - Python-神经网络模型能够从音频演讲中
- Python-深度增强学习算法的PyTorch实现策
- Python-基于深度学习的语音增强使用
- Python-基于知识图谱的红楼梦人物关系
- Python-STGAN用于图像合成的空间变换生
- Python-利用GAN进行图片填充
- Python-基于50W携程出行攻略的顺承事件
- Python-在TensorFlow中实现实现图像卷积网
- Python-60DaysRLChallenge中文版强化学习6
- Python-一个非常简单的BiLSTMCRF模型用于
- Python-Tensorflow仿AlphaGo框架实现的AI围棋
- Python-我是小诗姬全唐诗作为训练数据
- Python-用于物体跟踪的全卷积连体网络
- Python-数学建模竞赛中所使用的相关算
- Python-MonoDepthPyTorchPyTorch无监督单目深
- Python-用Tensorflowjs实现的可回收非可回
- Python-利用TensorFlow中的深度学习进行图
- Python-TensorFlow快速入门与实战课件与参
- Python-FCN完全卷积网络中最简单最容易
- Python-匈牙利算法卡尔曼滤波器多目标
- Python-mathAI一个拍照做题程序输入一张
- Python-Tensorflow实现SpatialAsDeepSpatialCNN
评论
共有 条评论