application_densenet: Instantiates the DenseNet architecture.

Description Usage Arguments Details

View source: R/applications.R

Description

Instantiates the DenseNet architecture.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
application_densenet(
  blocks,
  include_top = TRUE,
  weights = "imagenet",
  input_tensor = NULL,
  input_shape = NULL,
  pooling = NULL,
  classes = 1000
)

application_densenet121(
  include_top = TRUE,
  weights = "imagenet",
  input_tensor = NULL,
  input_shape = NULL,
  pooling = NULL,
  classes = 1000
)

application_densenet169(
  include_top = TRUE,
  weights = "imagenet",
  input_tensor = NULL,
  input_shape = NULL,
  pooling = NULL,
  classes = 1000
)

application_densenet201(
  include_top = TRUE,
  weights = "imagenet",
  input_tensor = NULL,
  input_shape = NULL,
  pooling = NULL,
  classes = 1000
)

densenet_preprocess_input(x, data_format = NULL)

Arguments

blocks

numbers of building blocks for the four dense layers.

include_top

whether to include the fully-connected layer at the top of the network.

weights

one of NULL (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded.

input_tensor

optional Keras tensor (i.e. output of layer_input()) to use as image input for the model.

input_shape

optional shape list, only to be specified if include_top is FALSE (otherwise the input shape has to be (224, 224, 3) (with channels_last data format) or (3, 224, 224) (with channels_first data format). It should have exactly 3 inputs channels.

pooling

optional pooling mode for feature extraction when include_top is FALSE. - NULL means that the output of the model will be the 4D tensor output of the last convolutional layer. - avg means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. - max means that global max pooling will be applied.

classes

optional number of classes to classify images into, only to be specified if include_top is TRUE, and if no weights argument is specified.

x

a 3D or 4D array consists of RGB values within [0, 255].

data_format

data format of the image tensor.

Details

Optionally loads weights pre-trained on ImageNet. Note that when using TensorFlow, for best performance you should set image_data_format='channels_last' in your Keras config at ~/.keras/keras.json.

The model and the weights are compatible with TensorFlow, Theano, and CNTK. The data format convention used by the model is the one specified in your Keras config file.


dfalbel/keras documentation built on Nov. 27, 2019, 8:16 p.m.