SqueezeNet¶
- class paddle.vision.models. SqueezeNet ( version, num_classes=1000, with_pool=True ) [source]
-
SqueezeNet model from “SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size”.
- Parameters
-
version (str) – Version of SqueezeNet, which can be “1.0” or “1.1”.
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.
- Returns
-
Layer. An instance of SqueezeNet model.
Examples
>>> import paddle >>> from paddle.vision.models import SqueezeNet >>> # build v1.0 model >>> model = SqueezeNet(version='1.0') >>> # build v1.1 model >>> # model = SqueezeNet(version='1.1') >>> x = paddle.rand([1, 3, 224, 224]) >>> out = model(x) >>> print(out.shape) [1, 1000]
-
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