Functions | |
def | SEResNet (input_shape=None, initial_conv_filters=64, depth=[3, filters=[64, width=1, bottleneck=False, weight_decay=1e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
def | SEResNet18 (input_shape=None, width=1, bottleneck=False, weight_decay=1e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
def | SEResNet34 (input_shape=None, width=1, bottleneck=False, weight_decay=1e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
def | SEResNet50 (input_shape=None, width=1, bottleneck=True, weight_decay=1e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
def | SEResNet101 (input_shape=None, width=1, bottleneck=True, weight_decay=1e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
def | SEResNet154 (input_shape=None, width=1, bottleneck=True, weight_decay=1e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
def | _resnet_block (input, filters, k=1, strides=(1, 1)) |
def | _resnet_bottleneck_block (input, filters, k=1, strides=(1, 1)) |
def | _create_se_resnet (classes, img_input, include_top, initial_conv_filters, filters, depth, width, bottleneck, weight_decay, pooling) |
Variables | |
list | __all__ = ['SEResNet', 'SEResNet50', 'SEResNet101', 'SEResNet154', 'preprocess_input', 'decode_predictions'] |
string | WEIGHTS_PATH = "" |
string | WEIGHTS_PATH_NO_TOP = "" |
Based on https://github.com/titu1994/keras-squeeze-excite-network/blob/master/se_resnet.py Squeeze-and-Excitation ResNets References: - [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) - []() # added when paper is published on Arxiv
|
private |
Creates a SE ResNet model with specified parameters Args: initial_conv_filters: number of features for the initial convolution include_top: Flag to include the last dense layer filters: number of filters per block, defined as a list. filters = [64, 128, 256, 512 depth: number or layers in the each block, defined as a list. ResNet-50 = [3, 4, 6, 3] ResNet-101 = [3, 6, 23, 3] ResNet-152 = [3, 8, 36, 3] width: width multiplier for network (for Wide ResNet) bottleneck: adds a bottleneck conv to reduce computation weight_decay: weight_decay (l2 norm) pooling: Optional pooling mode for feature extraction when `include_top` is `False`. - `None` means that the output of the model will be the 4D tensor output of the last convolutional layer. - `avg` means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. - `max` means that global max pooling will be applied. Returns: a Keras Model
Definition at line 330 of file se_resnet_saul.py.
|
private |
Adds a pre-activation resnet block without bottleneck layers Args: input: input tensor filters: number of output filters k: width factor strides: strides of the convolution layer Returns: a keras tensor
Definition at line 251 of file se_resnet_saul.py.
|
private |
Adds a pre-activation resnet block with bottleneck layers Args: input: input tensor filters: number of output filters k: width factor strides: strides of the convolution layer Returns: a keras tensor
Definition at line 287 of file se_resnet_saul.py.
def se_resnet_saul.SEResNet | ( | input_shape = None , |
|
initial_conv_filters = 64 , |
|||
depth = [3 , |
|||
filters = [64 , |
|||
width = 1 , |
|||
bottleneck = False , |
|||
weight_decay = 1e-4 , |
|||
include_top = True , |
|||
weights = None , |
|||
input_tensor = None , |
|||
pooling = None , |
|||
classes = 1000 |
|||
) |
Instantiate the Squeeze and Excite ResNet architecture. Note that , when using TensorFlow for best performance you should set `image_data_format="channels_last"` in your Keras config at ~/.keras/keras.json. The model are compatible with both TensorFlow and Theano. The dimension ordering convention used by the model is the one specified in your Keras config file. # Arguments initial_conv_filters: number of features for the initial convolution depth: number or layers in the each block, defined as a list. ResNet-50 = [3, 4, 6, 3] ResNet-101 = [3, 6, 23, 3] ResNet-152 = [3, 8, 36, 3] filter: number of filters per block, defined as a list. filters = [64, 128, 256, 512 width: width multiplier for the network (for Wide ResNets) bottleneck: adds a bottleneck conv to reduce computation weight_decay: weight decay (l2 norm) include_top: whether to include the fully-connected layer at the top of the network. weights: `None` (random initialization) or `imagenet` (trained on ImageNet) input_tensor: optional Keras tensor (i.e. output of `layers.Input()`) to use as image input for the model. input_shape: optional shape tuple, only to be specified if `include_top` is False (otherwise the input shape has to be `(224, 224, 3)` (with `tf` dim ordering) or `(3, 224, 224)` (with `th` dim ordering). It should have exactly 3 inputs channels, and width and height should be no smaller than 8. E.g. `(200, 200, 3)` would be one valid value. pooling: Optional pooling mode for feature extraction when `include_top` is `False`. - `None` means that the output of the model will be the 4D tensor output of the last convolutional layer. - `avg` means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. - `max` means that global max pooling will be applied. classes: optional number of classes to classify images into, only to be specified if `include_top` is True, and if no `weights` argument is specified. # Returns A Keras model instance.
Definition at line 56 of file se_resnet_saul.py.
def se_resnet_saul.SEResNet101 | ( | input_shape = None , |
|
width = 1 , |
|||
bottleneck = True , |
|||
weight_decay = 1e-4 , |
|||
include_top = True , |
|||
weights = None , |
|||
input_tensor = None , |
|||
pooling = None , |
|||
classes = 1000 |
|||
) |
Definition at line 217 of file se_resnet_saul.py.
def se_resnet_saul.SEResNet154 | ( | input_shape = None , |
|
width = 1 , |
|||
bottleneck = True , |
|||
weight_decay = 1e-4 , |
|||
include_top = True , |
|||
weights = None , |
|||
input_tensor = None , |
|||
pooling = None , |
|||
classes = 1000 |
|||
) |
Definition at line 238 of file se_resnet_saul.py.
def se_resnet_saul.SEResNet18 | ( | input_shape = None , |
|
width = 1 , |
|||
bottleneck = False , |
|||
weight_decay = 1e-4 , |
|||
include_top = True , |
|||
weights = None , |
|||
input_tensor = None , |
|||
pooling = None , |
|||
classes = 1000 |
|||
) |
Definition at line 155 of file se_resnet_saul.py.
def se_resnet_saul.SEResNet34 | ( | input_shape = None , |
|
width = 1 , |
|||
bottleneck = False , |
|||
weight_decay = 1e-4 , |
|||
include_top = True , |
|||
weights = None , |
|||
input_tensor = None , |
|||
pooling = None , |
|||
classes = 1000 |
|||
) |
Definition at line 176 of file se_resnet_saul.py.
def se_resnet_saul.SEResNet50 | ( | input_shape = None , |
|
width = 1 , |
|||
bottleneck = True , |
|||
weight_decay = 1e-4 , |
|||
include_top = True , |
|||
weights = None , |
|||
input_tensor = None , |
|||
pooling = None , |
|||
classes = 1000 |
|||
) |
Definition at line 197 of file se_resnet_saul.py.
|
private |
Definition at line 38 of file se_resnet_saul.py.
string se_resnet_saul.WEIGHTS_PATH = "" |
Definition at line 41 of file se_resnet_saul.py.
string se_resnet_saul.WEIGHTS_PATH_NO_TOP = "" |
Definition at line 42 of file se_resnet_saul.py.