VGG

class paddle.vision.models. VGG ( features, num_classes=1000, with_pool=True ) [source]

VGG model from “Very Deep Convolutional Networks For Large-Scale Image Recognition”

Parameters
  • features (nn.Layer) – Vgg features create by function make_layers.

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

  • with_pool (bool) – Use pool before the last three fc layer or not. Default: True.

Examples

from paddle.vision.models import VGG
from paddle.vision.models.vgg import make_layers

vgg11_cfg = [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M']

features = make_layers(vgg11_cfg)

vgg11 = VGG(features)
forward ( x )

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

Parameters
  • *inputs (tuple) – unpacked tuple arguments

  • **kwargs (dict) – unpacked dict arguments