-
大小: 4.64MB文件类型: .zip金币: 2下载: 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-BDD100K大规模多样化驾驶视频数据
- Python-DeepMoji模型的pyTorch实现
- Python-使用DeepFakes实现YouTube视频自动换
- Python-一系列高品质的动漫人脸数据集
- Python-Insightface人脸检测识别的最小化
- Python-自然场景文本检测PSENet的一个
- Python-在特征金字塔网络FPN的Pytorch实现
- Python-PyTorch实时多人姿态估计项目的实
- Python-用PyTorch10实现FasterRCNN和MaskRCNN比
- Python-心脏核磁共振MRI图像分割
- Python-基于YOLOv3的行人检测
- Python-RLSeq2Seq用于SequencetoSequence模型的
- Python-PyTorch对卷积CRF的参考实现
- Python-高效准确的EAST文本检测器的一个
- Python-pytorch实现的人脸检测和人脸识别
- Python-UNet用于医学图像分割的嵌套UN
- Python-TensorFlow弱监督图像分割
- 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用于图像合成的空间变换生
评论
共有 条评论