lfcnn.layers package

Subpackages

Submodules

lfcnn.layers.layers module

lfcnn.layers.layers._res_block_factory(conv_class, x, filters, kernel_size, kernel_regularizer, name)[source]

Factory to create residual convolution layers in 2D or 3D. Should not be used directly, instead use :func:res_block_2d`or `:func:res_block_3d.

Parameters
  • conv_class – Used convolution class. Use ‘keras.layers.Conv2D’ for 2D residual convolution. Use ‘keras.layers.Conv3D’ for 2D residual convolution.

  • x – Input tensor.

  • filters – Number of filters per convolution layer.

  • kernel_size – Size of the convolution kernels.

  • kernel_regularizer – Optional kernel regularizer.

  • name – Optional name for the layer.

lfcnn.layers.layers._sample_up_down_factory(conv_class, x, filters, kernel_size=3, strides=2, kernel_regularizer=None, name=None)[source]

Factory to create up/downsampling layers based on strided/transposed convolution. Should not be used directly, instead use :func:sample_up_2d and :func:sample_down_2d or :func:sample_up_3d and :func:sample_down_3d.

Parameters
  • conv_class – Used convolution class. Use ‘keras.layers.Conv2D’ for 2D residual convolution. Use ‘keras.layers.Conv3D’ for 2D residual convolution.

  • x – Input tensor.

  • num_filters – Number of filters per convolution layer.

  • kernel_size – Size of the convolution kernels.

  • strides – Stride used for up/downsampling.

  • kernel_regularizer – Optional kernel regularizer.

  • name – Optional name for the layer.

Returns:

lfcnn.layers.layers.res_block_2d(x, filters, kernel_size=(3, 3), kernel_regularizer=None, name=None)[source]

Residual convolution using Conv2D. For options, see :func:res_block_factory.

lfcnn.layers.layers.res_block_3d(x, filters, kernel_size=(3, 3, 3), kernel_regularizer=None, name=None)[source]

Residual convolution using Conv3D. For options, see :func:res_block_factory.

lfcnn.layers.layers.reshape_3d_to_2d(x, name=None)[source]
lfcnn.layers.layers.sample_down_2d(x, filters, kernel_size=(3, 3), strides=(2, 2), kernel_regularizer=None, name=None)[source]

Downsampling via 2D strided convolution. For options, see :func:sample_up_down_factory.

lfcnn.layers.layers.sample_down_3d(x, filters, kernel_size=(3, 3, 3), strides=(2, 2, 2), kernel_regularizer=None, name=None)[source]

Downsampling via 3D strided convolution. For options, see :func:sample_up_down_factory.

lfcnn.layers.layers.sample_up_2d(x, filters, kernel_size=(3, 3), strides=(2, 2), kernel_regularizer=None, name=None)[source]

Upsampling via 2D transposed convolution. For options, see :func:sample_up_down_factory.

lfcnn.layers.layers.sample_up_3d(x, filters, kernel_size=(3, 3, 3), strides=(2, 2, 2), kernel_regularizer=None, name=None)[source]

Downsampling via 3D transposed convolution. For options, see :func:sample_up_down_factory.

lfcnn.layers.layers.soft_threshold(x, value)[source]

Module contents

The LFCNN layers module.

lfcnn.layers.get(layer)[source]

Given a layer name, returns an lfcnn layer callable.

Parameters

layer (str) – Name of the layer.

Return type

callable

Returns

Layer callable.