GoogLeNet¶
- class paddle.vision.models. GoogLeNet ( num_classes=1000, with_pool=True ) [source]
-
GoogLeNet (Inception v1) model architecture from “Going Deeper with Convolutions”.
- Parameters
-
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 GoogLeNet (Inception v1) model.
Examples
>>> import paddle >>> from paddle.vision.models import GoogLeNet >>> # Build model >>> model = GoogLeNet() >>> x = paddle.rand([1, 3, 224, 224]) >>> out, out1, out2 = model(x) >>> print(out.shape, out1.shape, out2.shape) [1, 1000] [1, 1000] [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