Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update pooling.py
`channels_first` ->`"channels_first"`
`channels_last` ->`"channels_last"`
  "channels_last"->`"channels_last"`
  • Loading branch information
Naruu authored Oct 19, 2019
commit d249f47addcf5f10f23689e71f1deee1b53456c3
88 changes: 44 additions & 44 deletions keras/layers/pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ class MaxPooling1D(_Pooling1D):
If None, it will default to `pool_size`.
padding: One of `"valid"` or `"same"` (case-insensitive).
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, steps, features)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, steps, features)` while `"channels_first"`
corresponds to inputs with shape
`(batch, features, steps)`.

Expand Down Expand Up @@ -124,10 +124,10 @@ class AveragePooling1D(_Pooling1D):
If None, it will default to `pool_size`.
padding: One of `"valid"` or `"same"` (case-insensitive).
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, steps, features)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, steps, features)` while `"channels_first"`
corresponds to inputs with shape
`(batch, features, steps)`.

Expand Down Expand Up @@ -228,15 +228,15 @@ class MaxPooling2D(_Pooling2D):
If None, it will default to `pool_size`.
padding: One of `"valid"` or `"same"` (case-insensitive).
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, height, width, channels)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, height, width, channels)` while `"channels_first"`
corresponds to inputs with shape
`(batch, channels, height, width)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand Down Expand Up @@ -283,15 +283,15 @@ class AveragePooling2D(_Pooling2D):
If None, it will default to `pool_size`.
padding: One of `"valid"` or `"same"` (case-insensitive).
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, height, width, channels)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, height, width, channels)` while `"channels_first"`
corresponds to inputs with shape
`(batch, channels, height, width)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand Down Expand Up @@ -394,15 +394,15 @@ class MaxPooling3D(_Pooling3D):
If None, it will default to `pool_size`.
padding: One of `"valid"` or `"same"` (case-insensitive).
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`"channels_last"` corresponds to inputs with shape
`(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)`
while `channels_first` corresponds to inputs with shape
while `"channels_first"` corresponds to inputs with shape
`(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand Down Expand Up @@ -445,15 +445,15 @@ class AveragePooling3D(_Pooling3D):
If None, it will default to `pool_size`.
padding: One of `"valid"` or `"same"` (case-insensitive).
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`"channels_last"` corresponds to inputs with shape
`(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)`
while `channels_first` corresponds to inputs with shape
while `"channels_first"` corresponds to inputs with shape
`(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand Down Expand Up @@ -515,10 +515,10 @@ class GlobalAveragePooling1D(_GlobalPooling1D):

# Arguments
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, steps, features)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, steps, features)` while `"channels_first"`
corresponds to inputs with shape
`(batch, features, steps)`.

Expand Down Expand Up @@ -561,10 +561,10 @@ class GlobalMaxPooling1D(_GlobalPooling1D):

# Arguments
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, steps, features)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, steps, features)` while `"channels_first"`
corresponds to inputs with shape
`(batch, features, steps)`.

Expand Down Expand Up @@ -616,15 +616,15 @@ class GlobalAveragePooling2D(_GlobalPooling2D):

# Arguments
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, height, width, channels)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, height, width, channels)` while `"channels_first"`
corresponds to inputs with shape
`(batch, channels, height, width)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand All @@ -651,15 +651,15 @@ class GlobalMaxPooling2D(_GlobalPooling2D):

# Arguments
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`(batch, height, width, channels)` while `channels_first`
`"channels_last"` corresponds to inputs with shape
`(batch, height, width, channels)` while `"channels_first"`
corresponds to inputs with shape
`(batch, channels, height, width)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand Down Expand Up @@ -711,15 +711,15 @@ class GlobalAveragePooling3D(_GlobalPooling3D):

# Arguments
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`"channels_last"` corresponds to inputs with shape
`(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)`
while `channels_first` corresponds to inputs with shape
while `"channels_first"` corresponds to inputs with shape
`(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand All @@ -746,15 +746,15 @@ class GlobalMaxPooling3D(_GlobalPooling3D):

# Arguments
data_format: A string,
one of `channels_last` (default) or `channels_first`.
one of `"channels_last"` (default) or `"channels_first"`.
The ordering of the dimensions in the inputs.
`channels_last` corresponds to inputs with shape
`"channels_last"` corresponds to inputs with shape
`(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)`
while `channels_first` corresponds to inputs with shape
while `"channels_first"` corresponds to inputs with shape
`(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`.
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
If you never set it, then it will be `"channels_last"`.

# Input shape
- If `data_format='channels_last'`:
Expand Down