DenseNet

class paddle.vision.models. DenseNet ( layers=121, bn_size=4, dropout=0.0, num_classes=1000, with_pool=True ) [source]

DenseNet model from “Densely Connected Convolutional Networks”

Parameters
  • layers (int) – layers of densenet. Default: 121.

  • bn_size (int) – expansion of growth rate in the middle layer. Default: 4.

  • dropout (float) – dropout rate. Default: 0..

  • num_classes (int) – output dim of last fc layer. Default: 1000.

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

Examples

import paddle
from paddle.vision.models import DenseNet

# build model
densenet = DenseNet()

x = paddle.rand([1, 3, 224, 224])
out = densenet(x)

print(out.shape)
forward ( input )

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