Functions | |
| def | SEResNext (input_shape=None, depth=29, cardinality=8, width=64, weight_decay=5e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=10) |
| def | SEResNextImageNet (input_shape=None, depth=[3, cardinality=32, width=4, weight_decay=5e-4, include_top=True, weights=None, input_tensor=None, pooling=None, classes=1000) |
| def | __initial_conv_block (input, weight_decay=5e-4) |
| def | __initial_conv_block_inception (input, weight_decay=5e-4) |
| def | __grouped_convolution_block (input, grouped_channels, cardinality, strides, weight_decay=5e-4) |
| def | __bottleneck_block (input, filters=64, cardinality=8, strides=1, weight_decay=5e-4) |
| def | __create_res_next (nb_classes, img_input, include_top, depth=29, cardinality=8, width=4, weight_decay=5e-4, pooling=None) |
| def | __create_res_next_imagenet (nb_classes, img_input, include_top, depth, cardinality=32, width=4, weight_decay=5e-4, pooling=None) |
Variables | |
| string | CIFAR_TH_WEIGHTS_PATH = '' |
| string | CIFAR_TF_WEIGHTS_PATH = '' |
| string | CIFAR_TH_WEIGHTS_PATH_NO_TOP = '' |
| string | CIFAR_TF_WEIGHTS_PATH_NO_TOP = '' |
| string | IMAGENET_TH_WEIGHTS_PATH = '' |
| string | IMAGENET_TF_WEIGHTS_PATH = '' |
| string | IMAGENET_TH_WEIGHTS_PATH_NO_TOP = '' |
| string | IMAGENET_TF_WEIGHTS_PATH_NO_TOP = '' |
ResNeXt models for Keras. # Reference - [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf))
|
private |
Adds a bottleneck block
Args:
input: input tensor
filters: number of output filters
cardinality: cardinality factor described number of
grouped convolutions
strides: performs strided convolution for downsampling if > 1
weight_decay: weight decay factor
Returns: a keras tensor
Definition at line 312 of file se_resnext.py.
|
private |
Creates a ResNeXt model with specified parameters
Args:
nb_classes: Number of output classes
img_input: Input tensor or layer
include_top: Flag to include the last dense layer
depth: Depth of the network. Can be an positive integer or a list
Compute N = (n - 2) / 9.
For a depth of 56, n = 56, N = (56 - 2) / 9 = 6
For a depth of 101, n = 101, N = (101 - 2) / 9 = 11
cardinality: the size of the set of transformations.
Increasing cardinality improves classification accuracy,
width: Width of the network.
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 361 of file se_resnext.py.
|
private |
Creates a ResNeXt model with specified parameters
Args:
nb_classes: Number of output classes
img_input: Input tensor or layer
include_top: Flag to include the last dense layer
depth: Depth of the network. List of integers.
Increasing cardinality improves classification accuracy,
width: Width of the network.
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 436 of file se_resnext.py.
|
private |
Adds a grouped convolution block. It is an equivalent block from the paper
Args:
input: input tensor
grouped_channels: grouped number of filters
cardinality: cardinality factor describing the number of groups
strides: performs strided convolution for downscaling if > 1
weight_decay: weight decay term
Returns: a keras tensor
Definition at line 272 of file se_resnext.py.
|
private |
Adds an initial convolution block, with batch normalization and relu activation
Args:
input: input tensor
weight_decay: weight decay factor
Returns: a keras tensor
Definition at line 236 of file se_resnext.py.
|
private |
Adds an initial conv block, with batch norm and relu for the inception resnext
Args:
input: input tensor
weight_decay: weight decay factor
Returns: a keras tensor
Definition at line 253 of file se_resnext.py.
| def se_resnext.SEResNext | ( | input_shape = None, |
|
depth = 29, |
|||
cardinality = 8, |
|||
width = 64, |
|||
weight_decay = 5e-4, |
|||
include_top = True, |
|||
weights = None, |
|||
input_tensor = None, |
|||
pooling = None, |
|||
classes = 10 |
|||
| ) |
Instantiate the ResNeXt 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
depth: number or layers in the ResNeXt model. Can be an
integer or a list of integers.
cardinality: the size of the set of transformations
width: multiplier to the ResNeXt width (number of filters)
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)
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 `(32, 32, 3)` (with `tf` dim ordering)
or `(3, 32, 32)` (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 48 of file se_resnext.py.
| def se_resnext.SEResNextImageNet | ( | input_shape = None, |
|
depth = [3, |
|||
cardinality = 32, |
|||
width = 4, |
|||
weight_decay = 5e-4, |
|||
include_top = True, |
|||
weights = None, |
|||
input_tensor = None, |
|||
pooling = None, |
|||
classes = 1000 |
|||
| ) |
Instantiate the SE ResNeXt architecture for the ImageNet dataset. 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
depth: number or layers in the each block, defined as a list.
ResNeXt-50 can be defined as [3, 4, 6, 3].
ResNeXt-101 can be defined as [3, 4, 23, 3].
Defaults is ResNeXt-50.
cardinality: the size of the set of transformations
width: multiplier to the ResNeXt width (number of filters)
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 146 of file se_resnext.py.
| string se_resnext.CIFAR_TF_WEIGHTS_PATH = '' |
Definition at line 29 of file se_resnext.py.
| string se_resnext.CIFAR_TF_WEIGHTS_PATH_NO_TOP = '' |
Definition at line 31 of file se_resnext.py.
| string se_resnext.CIFAR_TH_WEIGHTS_PATH = '' |
Definition at line 28 of file se_resnext.py.
| string se_resnext.CIFAR_TH_WEIGHTS_PATH_NO_TOP = '' |
Definition at line 30 of file se_resnext.py.
| string se_resnext.IMAGENET_TF_WEIGHTS_PATH = '' |
Definition at line 34 of file se_resnext.py.
| string se_resnext.IMAGENET_TF_WEIGHTS_PATH_NO_TOP = '' |
Definition at line 36 of file se_resnext.py.
| string se_resnext.IMAGENET_TH_WEIGHTS_PATH = '' |
Definition at line 33 of file se_resnext.py.
| string se_resnext.IMAGENET_TH_WEIGHTS_PATH_NO_TOP = '' |
Definition at line 35 of file se_resnext.py.
1.8.11