def ResNet152(inputs, blocks=None, include_top=True, classes=1000, *args, **kwargs):
"""
Constructs a `keras.models.Model` according to the ResNet152 specifications.
:param inputs: input tensor (e.g. an instance of `keras.layers.Input`)
:param blocks: the network’s residual architecture
:param include_top: if true, includes classification layers
:param classes: number of classes to classify (include_top must be true)
:return model: ResNet model with encoding output (if `include_top=False`) or classification output (if `include_top=True`)
Usage:
>>> import keras_resnet.models
>>> shape, classes = (224, 224, 3), 1000
>>> x = keras.layers.Input(shape)
>>> model = keras_resnet.models.ResNet152(x, classes=classes)
>>> model.compile("adam", "categorical_crossentropy", ["accuracy"])
"""
if blocks is None:
blocks = [3, 8, 36, 3]
numerical_names = [False, True, True, False]
return ResNet(inputs, blocks, numerical_names=numerical_names, block=keras_resnet.blocks.bottleneck_2d, include_top=include_top, classes=classes, *args, **kwargs)
评论列表
文章目录