Skip to content

Commit

Permalink
Merge pull request #17954 from SamuelMarks:keras.applications-default…
Browse files Browse the repository at this point in the history
…s-to

PiperOrigin-RevId: 535295013
  • Loading branch information
tensorflower-gardener committed May 25, 2023
2 parents f4331f7 + 5879670 commit a8d4a7f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 39 deletions.
20 changes: 10 additions & 10 deletions keras/applications/convnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
Args:
include_top: Whether to include the fully-connected
layer at the top of the network. Defaults to True.
layer at the top of the network. Defaults to `True`.
weights: One of `None` (random initialization),
`"imagenet"` (pre-training on ImageNet-1k), or the path to the weights
file to be loaded. Defaults to `"imagenet"`.
Expand All @@ -135,7 +135,7 @@
if `include_top` is False.
It should have exactly 3 inputs channels.
pooling: Optional pooling mode for feature extraction
when `include_top` is `False`. Defaults to None.
when `include_top` is `False`.
- `None` means that the output of the model will be
the 4D tensor output of the last convolutional layer.
- `avg` means that global average pooling
Expand All @@ -144,16 +144,16 @@
the output of the model will be a 2D tensor.
- `max` means that global max pooling will
be applied.
Defaults to `None`.
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. Defaults to 1000 (number of
ImageNet classes).
if no `weights` argument is specified. 1000 is how many
ImageNet classes there are. Defaults to `1000`.
classifier_activation: A `str` or callable. The activation function to use
on the "top" layer. Ignored unless `include_top=True`. Set
`classifier_activation=None` to return the logits of the "top" layer.
Defaults to `"softmax"`.
When loading pretrained weights, `classifier_activation` can only
be `None` or `"softmax"`.
be `None` or `"softmax"`. Defaults to `"softmax"`.
Returns:
A `keras.Model` instance.
Expand Down Expand Up @@ -754,10 +754,10 @@ def preprocess_input(x, data_format=None):
Args:
x: A floating point `numpy.array` or a `tf.Tensor`.
data_format: Optional data format of the image tensor/array. Defaults to
None, in which case the global setting
`tf.keras.backend.image_data_format()` is used (unless you changed it,
it defaults to "channels_last").{mode}
data_format: Optional data format of the image tensor/array. `None` means
the global setting `tf.keras.backend.image_data_format()` is used
(unless you changed it, it uses "channels_last").
Defaults to `None`.
Returns:
Unchanged `numpy.array` or `tf.Tensor`.
Expand Down
19 changes: 10 additions & 9 deletions keras/applications/efficientnet_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
Args:
include_top: Boolean, whether to include the fully-connected
layer at the top of the network. Defaults to True.
layer at the top of the network. Defaults to `True`.
weights: One of `None` (random initialization),
`"imagenet"` (pre-training on ImageNet),
or the path to the weights file to be loaded. Defaults to `"imagenet"`.
Expand All @@ -585,7 +585,7 @@
if `include_top` is False.
It should have exactly 3 inputs channels.
pooling: Optional pooling mode for feature extraction
when `include_top` is `False`. Defaults to None.
when `include_top` is `False`.
- `None` means that the output of the model will be
the 4D tensor output of the
last convolutional layer.
Expand All @@ -595,16 +595,17 @@
the output of the model will be a 2D tensor.
- `"max"` means that global max pooling will
be applied.
Defaults to `None`.
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. Defaults to 1000 (number of
ImageNet classes).
if no `weights` argument is specified. 1000 is how many
ImageNet classes there are. Defaults to `1000`.
classifier_activation: A string or callable. The activation function to use
on the `"top"` layer. Ignored unless `include_top=True`. Set
`classifier_activation=None` to return the logits of the "top" layer.
Defaults to `"softmax"`.
When loading pretrained weights, `classifier_activation` can only
be `None` or `"softmax"`.
Defaults to `"softmax"`.
Returns:
A `keras.Model` instance.
Expand Down Expand Up @@ -1342,10 +1343,10 @@ def preprocess_input(x, data_format=None):
Args:
x: A floating point `numpy.array` or a `tf.Tensor`.
data_format: Optional data format of the image tensor/array. Defaults to
None, in which case the global setting
`tf.keras.backend.image_data_format()` is used (unless you changed it,
it defaults to "channels_last").{mode}
data_format: Optional data format of the image tensor/array. `None` means
the global setting `tf.keras.backend.image_data_format()` is used
(unless you changed it, it uses "channels_last").
Defaults to `None`.
Returns:
Unchanged `numpy.array` or `tf.Tensor`.
Expand Down
20 changes: 10 additions & 10 deletions keras/applications/regnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
Args:
include_top: Whether to include the fully-connected
layer at the top of the network. Defaults to True.
layer at the top of the network. Defaults to `True`.
weights: One of `None` (random initialization),
`"imagenet"` (pre-training on ImageNet), or the path to the weights
file to be loaded. Defaults to `"imagenet"`.
Expand All @@ -353,7 +353,7 @@
if `include_top` is False.
It should have exactly 3 inputs channels.
pooling: Optional pooling mode for feature extraction
when `include_top` is `False`. Defaults to None.
when `include_top` is `False`.
- `None` means that the output of the model will be
the 4D tensor output of the
last convolutional layer.
Expand All @@ -363,16 +363,16 @@
the output of the model will be a 2D tensor.
- `max` means that global max pooling will
be applied.
Defaults to `None`.
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. Defaults to 1000 (number of
ImageNet classes).
if no `weights` argument is specified. 1000 is how many
ImageNet classes there are. Defaults to `1000`.
classifier_activation: A `str` or callable. The activation function to use
on the "top" layer. Ignored unless `include_top=True`. Set
`classifier_activation=None` to return the logits of the "top" layer.
Defaults to `"softmax"`.
When loading pretrained weights, `classifier_activation` can only
be `None` or `"softmax"`.
be `None` or `"softmax"`. Defaults to `"softmax"`.
Returns:
A `keras.Model` instance.
Expand Down Expand Up @@ -1819,10 +1819,10 @@ def preprocess_input(x, data_format=None):
Args:
x: A floating point `numpy.array` or a `tf.Tensor`.
data_format: Optional data format of the image tensor/array. Defaults to
None, in which case the global setting
`tf.keras.backend.image_data_format()` is used (unless you changed it,
it defaults to "channels_last").{mode}
data_format: Optional data format of the image tensor/array. `None` means
the global setting `tf.keras.backend.image_data_format()` is used
(unless you changed it, it uses "channels_last").
Defaults to `None`.
Returns:
Unchanged `numpy.array` or `tf.Tensor`.
Expand Down
21 changes: 11 additions & 10 deletions keras/applications/resnet_rs.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@
`classifier_activation=None` to return the logits of the "top"
layer.
include_preprocessing: Boolean, whether to include the preprocessing
layer (`Rescaling`) at the bottom of the network. Defaults to
`True`. Note: Input image is normalized by ImageNet mean and
standard deviation.
layer (`Rescaling`) at the bottom of the network. Note: Input image
is normalized by ImageNet mean and standard deviation.
Defaults to `True`.
Returns:
A `keras.Model` instance.
Expand Down Expand Up @@ -582,9 +582,10 @@ def ResNetRS(
use on the "top" layer. Ignored unless `include_top=True`. Set
`classifier_activation=None` to return the logits of the "top" layer.
include_preprocessing: Boolean, whether to include the preprocessing
layer (`Rescaling`) at the bottom of the network. Defaults to `True`.
Note- Input image is normalized by ImageNet mean and standard
deviation.
layer (`Rescaling`) at the bottom of the network. Note - Input image
is normalized by ImageNet mean and standard deviation.
Defaults to `True`.
Returns:
A `tf.keras.Model` instance.
Expand Down Expand Up @@ -958,10 +959,10 @@ def preprocess_input(x, data_format=None):
Args:
x: A floating point `numpy.array` or a `tf.Tensor`.
data_format: Optional data format of the image tensor/array. Defaults to
None, in which case the global setting
`tf.keras.backend.image_data_format()` is used (unless you changed it,
it defaults to "channels_last").{mode}
data_format: Optional data format of the image tensor/array. `None` means
the global setting `tf.keras.backend.image_data_format()` is used
(unless you changed it, it uses "channels_last").
Defaults to `None`.
Returns:
Unchanged `numpy.array` or `tf.Tensor`.
Expand Down

0 comments on commit a8d4a7f

Please sign in to comment.