ShuffleNetV2

class paddle.vision.models. ShuffleNetV2 ( scale=1.0, act='relu', num_classes=1000, with_pool=True ) [source]

ShuffleNetV2 model from “ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design”

Parameters
  • scale (float, optional) – True.

  • act (str, optional) – “relu”.

  • num_classes (int, optional) – output dim of last fc layer. If num_classes <=0, last fc layer will not be defined. Default: 1000.

  • with_pool (bool, optional) – use pool before the last fc layer or not. Default: True.

Examples

import paddle
from paddle.vision.models import ShuffleNetV2

shufflenet_v2_swish = ShuffleNetV2(scale=1.0, act="swish")
x = paddle.rand([1, 3, 224, 224])
out = shufflenet_v2_swish(x)
print(out.shape)
forward ( inputs )

forward

Defines the computation performed at every call. Should be overridden by all subclasses.

Parameters
  • *inputs (tuple) – unpacked tuple arguments

  • **kwargs (dict) – unpacked dict arguments