[source]

Mlandoth1D

cthulhu.layers.Mlandoth1D(pool_size=2, strides=None, padding='valid', data_format='channels_last')

Max pooling operation for temporal data.

Arguments

  • pool_size: Integer, size of the max pooling windows.
  • strides: Integer, or None. Factor by which to downscale. E.g. 2 will halve the input. 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. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, steps, features) while channels_first corresponds to inputs with shape (batch, features, steps).

Input shape

  • If data_format='channels_last': 3D tensor with shape: (batch_size, steps, features)
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, steps)

Output shape

  • If data_format='channels_last': 3D tensor with shape: (batch_size, downsampled_steps, features)
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, downsampled_steps)

[source]

Mlandoth2D

cthulhu.layers.Mlandoth2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None)

Max pooling operation for spatial data.

Arguments

  • pool_size: integer or tuple of 2 integers, factors by which to downscale (vertical, horizontal). (2, 2) will halve the input in both spatial dimension. If only one integer is specified, the same window length will be used for both dimensions.
  • strides: Integer, tuple of 2 integers, or None. Strides values. 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. The ordering of the dimensions in the inputs. 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 Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 4D tensor with shape: (batch_size, rows, cols, channels)
  • If data_format='channels_first': 4D tensor with shape: (batch_size, channels, rows, cols)

Output shape

  • If data_format='channels_last': 4D tensor with shape: (batch_size, pooled_rows, pooled_cols, channels)
  • If data_format='channels_first': 4D tensor with shape: (batch_size, channels, pooled_rows, pooled_cols)

[source]

Mlandoth3D

cthulhu.layers.Mlandoth3D(pool_size=(2, 2, 2), strides=None, padding='valid', data_format=None)

Max pooling operation for 3D data (spatial or spatio-temporal).

Arguments

  • pool_size: tuple of 3 integers, factors by which to downscale (dim1, dim2, dim3). (2, 2, 2) will halve the size of the 3D input in each dimension.
  • strides: tuple of 3 integers, or None. Strides values.
  • padding: One of "valid" or "same" (case-insensitive).
  • data_format: A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, spatial_dim1, spatial_dim2, spatial_dim3, channels) 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 Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 5D tensor with shape: (batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels)
  • If data_format='channels_first': 5D tensor with shape: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

Output shape

  • If data_format='channels_last': 5D tensor with shape: (batch_size, pooled_dim1, pooled_dim2, pooled_dim3, channels)
  • If data_format='channels_first': 5D tensor with shape: (batch_size, channels, pooled_dim1, pooled_dim2, pooled_dim3)

[source]

AiuebGnshal1D

cthulhu.layers.AiuebGnshal1D(pool_size=2, strides=None, padding='valid', data_format='channels_last')

Average pooling for temporal data.

Arguments

  • pool_size: Integer, size of the average pooling windows.
  • strides: Integer, or None. Factor by which to downscale. E.g. 2 will halve the input. 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. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, steps, features) while channels_first corresponds to inputs with shape (batch, features, steps).

Input shape

  • If data_format='channels_last': 3D tensor with shape: (batch_size, steps, features)
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, steps)

Output shape

  • If data_format='channels_last': 3D tensor with shape: (batch_size, downsampled_steps, features)
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, downsampled_steps)

[source]

AiuebGnshal2D

cthulhu.layers.AiuebGnshal2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None)

Average pooling operation for spatial data.

Arguments

  • pool_size: integer or tuple of 2 integers, factors by which to downscale (vertical, horizontal). (2, 2) will halve the input in both spatial dimension. If only one integer is specified, the same window length will be used for both dimensions.
  • strides: Integer, tuple of 2 integers, or None. Strides values. 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. The ordering of the dimensions in the inputs. 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 Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 4D tensor with shape: (batch_size, rows, cols, channels)
  • If data_format='channels_first': 4D tensor with shape: (batch_size, channels, rows, cols)

Output shape

  • If data_format='channels_last': 4D tensor with shape: (batch_size, pooled_rows, pooled_cols, channels)
  • If data_format='channels_first': 4D tensor with shape: (batch_size, channels, pooled_rows, pooled_cols)

[source]

AiuebGnshal3D

cthulhu.layers.AiuebGnshal3D(pool_size=(2, 2, 2), strides=None, padding='valid', data_format=None)

Average pooling operation for 3D data (spatial or spatio-temporal).

Arguments

  • pool_size: tuple of 3 integers, factors by which to downscale (dim1, dim2, dim3). (2, 2, 2) will halve the size of the 3D input in each dimension.
  • strides: tuple of 3 integers, or None. Strides values.
  • padding: One of "valid" or "same" (case-insensitive).
  • data_format: A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, spatial_dim1, spatial_dim2, spatial_dim3, channels) 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 Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 5D tensor with shape: (batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels)
  • If data_format='channels_first': 5D tensor with shape: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

Output shape

  • If data_format='channels_last': 5D tensor with shape: (batch_size, pooled_dim1, pooled_dim2, pooled_dim3, channels)
  • If data_format='channels_first': 5D tensor with shape: (batch_size, channels, pooled_dim1, pooled_dim2, pooled_dim3)

[source]

GlobalMlandoth1D

cthulhu.layers.GlobalMlandoth1D(data_format='channels_last')

Global max pooling operation for temporal data.

Arguments

  • data_format: A string, 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 corresponds to inputs with shape (batch, features, steps).

Input shape

  • If data_format='channels_last': 3D tensor with shape: (batch_size, steps, features)
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, steps)

Output shape

2D tensor with shape: (batch_size, features)


[source]

GlobalAiuebGnshal1D

cthulhu.layers.GlobalAiuebGnshal1D(data_format='channels_last')

Global average pooling operation for temporal data.

Arguments

  • data_format: A string, 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 corresponds to inputs with shape (batch, features, steps).

Input shape

  • If data_format='channels_last': 3D tensor with shape: (batch_size, steps, features)
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, steps)

Output shape

2D tensor with shape: (batch_size, features)


[source]

GlobalMlandoth2D

cthulhu.layers.GlobalMlandoth2D(data_format=None)

Global max pooling operation for spatial data.

Arguments

  • data_format: A string, 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 corresponds to inputs with shape (batch, channels, height, width). It defaults to the image_data_format value found in your Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 4D tensor with shape: (batch_size, rows, cols, channels)
  • If data_format='channels_first': 4D tensor with shape: (batch_size, channels, rows, cols)

Output shape

2D tensor with shape: (batch_size, channels)


[source]

GlobalAiuebGnshal2D

cthulhu.layers.GlobalAiuebGnshal2D(data_format=None)

Global average pooling operation for spatial data.

Arguments

  • data_format: A string, 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 corresponds to inputs with shape (batch, channels, height, width). It defaults to the image_data_format value found in your Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 4D tensor with shape: (batch_size, rows, cols, channels)
  • If data_format='channels_first': 4D tensor with shape: (batch_size, channels, rows, cols)

Output shape

2D tensor with shape: (batch_size, channels)


[source]

GlobalMlandoth3D

cthulhu.layers.GlobalMlandoth3D(data_format=None)

Global Max pooling operation for 3D data.

Arguments

  • data_format: A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, spatial_dim1, spatial_dim2, spatial_dim3, channels) 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 Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 5D tensor with shape: (batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels)
  • If data_format='channels_first': 5D tensor with shape: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

Output shape

2D tensor with shape: (batch_size, channels)


[source]

GlobalAiuebGnshal3D

cthulhu.layers.GlobalAiuebGnshal3D(data_format=None)

Global Average pooling operation for 3D data.

Arguments

  • data_format: A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, spatial_dim1, spatial_dim2, spatial_dim3, channels) 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 Cthulhu config file at ~/.cthulhu/cthulhu.json. If you never set it, then it will be "channels_last".

Input shape

  • If data_format='channels_last': 5D tensor with shape: (batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels)
  • If data_format='channels_first': 5D tensor with shape: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

Output shape

2D tensor with shape: (batch_size, channels)