Classification

VGG

Net *eddl::download_vgg16(bool top = true, vector<int> input_shape = {})

Returns a VGG16 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A VGG16 Net* with the desired topology

Example:

Net* net = download_vgg16(); // Only convolutional part
Net* net = download_vgg16(false); // With dense part
Net* net = download_vgg16(true, {3, 64, 64}); // With new input shape
Net *eddl::download_vgg16_bn(bool top = true, vector<int> input_shape = {})

Returns a VGG16 model with BatchNormalization pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A VGG16-BN Net* with the desired topology

Example:

Net* net = download_vgg16_bn(); // Only convolutional part
Net* net = download_vgg16_bn(false); // With dense part
Net* net = download_vgg16_bn(true, {3, 64, 64}); // With new input shape
Net *eddl::download_vgg19(bool top = true, vector<int> input_shape = {})

Returns a VGG19 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A VGG19 Net* with the desired topology

Example:

Net* net = download_vgg19(); // Only convolutional part
Net* net = download_vgg19(false); // With dense part
Net* net = download_vgg19(true, {3, 64, 64}); // With new input shape
Net *eddl::download_vgg19_bn(bool top = true, vector<int> input_shape = {})

Returns a VGG19 model with BatchNormalization pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A VGG19-BN Net* with the desired topology

Example:

Net* net = download_vgg19_bn(); // Only convolutional part
Net* net = download_vgg19_bn(false); // With dense part
Net* net = download_vgg19_bn(true, {3, 64, 64}); // With new input shape

ResNet

Net *eddl::download_resnet18(bool top = true, vector<int> input_shape = {})

Returns a ResNet18 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A ResNet18 Net* with the desired topology

Example:

Net* net = download_resnet18(); // Only convolutional part
Net* net = download_resnet18(false); // With dense part
Net* net = download_resnet18(true, {3, 64, 64}); // With new input shape
Net *eddl::download_resnet34(bool top = true, vector<int> input_shape = {})

Returns a ResNet34 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A ResNet34 Net* with the desired topology

Example:

Net* net = download_resnet34(); // Only convolutional part
Net* net = download_resnet34(false); // With dense part
Net* net = download_resnet34(true, {3, 64, 64}); // With new input shape
Net *eddl::download_resnet50(bool top = true, vector<int> input_shape = {})

Returns a ResNet50 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A ResNet50 Net* with the desired topology

Example:

Net* net = download_resnet50(); // Only convolutional part
Net* net = download_resnet50(false); // With dense part
Net* net = download_resnet50(true, {3, 64, 64}); // With new input shape
Net *eddl::download_resnet101(bool top = true, vector<int> input_shape = {})

Returns a ResNet101 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A ResNet101 Net* with the desired topology

Example:

Net* net = download_resnet101(); // Only convolutional part
Net* net = download_resnet101(false); // With dense part
Net* net = download_resnet101(true, {3, 64, 64}); // With new input shape
Net *eddl::download_resnet152(bool top = true, vector<int> input_shape = {})

Returns a ResNet152 model pretrained with imagenet.

Parameters
  • top – If true, returns the model without the densely connected part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A ResNet152 Net* with the desired topology

Example:

Net* net = download_resnet152(); // Only convolutional part
Net* net = download_resnet152(false); // With dense part
Net* net = download_resnet152(true, {3, 64, 64}); // With new input shape

DenseNet

Net *eddl::download_densenet121(bool top = true, vector<int> input_shape = {})

Returns a DenseNet121 model pretrained with imagenet.

Parameters
  • top – If true, returns the feature extraction part and the last layer of the returned model is named “top”.

  • input_shape – Optional. To change the input shape of the model. The shape vector must not have the batch dimension.

Returns

A DenseNet121 Net* with the desired topology

Example:

Net* net = download_densenet121(); // Only convolutional part
Net* net = download_densenet121(false); // With dense part
Net* net = download_densenet121(true, {3, 64, 64}); // With new input shape