Core Structures (~ctlearn.core)#

Reference/API#

ctlearn.core Package#

ctlearn core functionalities

Functions#

build_fully_connect_keras_head(inputs, ...)

Build the fully connected head for the Keras-based CTLearn model.

dual_squeeze_excite_block(inputs[, ratio, name])

A channel & spatial (dual) squeeze-excite block.

channel_squeeze_excite_block(inputs[, ...])

A channel-wise squeeze-excite block.

spatial_squeeze_excite_block(inputs[, name])

A spatial squeeze-excite block.

build_fully_connect_pytorch_head(...)

Build the fully connected head for the PyTorch-based CTLearn model.

Classes#

ConvBackend()

Interface for framework-specific convolution and pooling layers.

CTLearnModel(*args, **kwargs)

Base component for creating a Keras model to be used in CTLearn.

SingleCNN(*args, **kwargs)

SingleCNN is the base class of a simple convolutional neural network model.

ResNet(*args, **kwargs)

ResNet is a residual neural network model.

LoadedModel(*args, **kwargs)

LoadedModel is a pre-trained Keras model.

KerasConvBackend()

Select Keras layers for square or hexagonal model backbones.

KerasSingleCNN(*args, **kwargs)

SingleCNN is a simple convolutional neural network model.

KerasResNet(*args, **kwargs)

ResNet is a residual neural network model.

KerasLoadedModel(*args, **kwargs)

LoadedModel is a pre-trained Keras model.

KerasSequence(DLDataReader, indices, tasks)

Generates batches for Keras application.

BasicBlock(in_channels, out_channels[, ...])

Basic block for ResNet architectures.

BottleneckBlock(in_channels, base_filters[, ...])

Bottleneck block for deeper ResNet architectures.

MultiFullyConnectedHead(heads_dict[, ...])

A PyTorch container module to hold the multi-task fully connected heads.

PyTorchConvBackend()

Select PyTorch layers for square or hexagonal model backbones.

PyTorchSingleCNN(*args, **kwargs)

SingleCNN is a simple convolutional neural network model implemented in PyTorch.

PyTorchResNet(*args, **kwargs)

PyTorchResNet is a residual neural network model implemented in PyTorch.

PyTorchLoadedModel(*args, **kwargs)

PyTorchLoadedModel is a pre-trained PyTorch model wrapper.

DualSqueezeExciteBlock(in_channels[, ratio])

A channel & spatial (dual) squeeze-excite block in PyTorch.

ChannelSqueezeExciteBlock(in_channels[, ratio])

A channel-wise squeeze-excite (cSE) block in PyTorch.

SpatialSqueezeExciteBlock(in_channels)

A spatial squeeze-excite (sSE) block in PyTorch.

PyTorchDataset(DLDataReader, indices, tasks)

Generates items/batches for PyTorch application based on DLDataReader.

ctlearn.core.model Module#

This module defines the CTLearnModel classes, which holds the basic functionality for creating a Keras model to be used in CTLearn.

Classes#

ConvBackend()

Interface for framework-specific convolution and pooling layers.

CTLearnModel(*args, **kwargs)

Base component for creating a Keras model to be used in CTLearn.

SingleCNN(*args, **kwargs)

SingleCNN is the base class of a simple convolutional neural network model.

ResNet(*args, **kwargs)

ResNet is a residual neural network model.

LoadedModel(*args, **kwargs)

LoadedModel is a pre-trained Keras model.

ctlearn.core.keras.model Module#

This module defines the CTLearnModel classes, which holds the basic functionality for creating a Keras model to be used in CTLearn.

Functions#

build_fully_connect_keras_head(inputs, ...)

Build the fully connected head for the Keras-based CTLearn model.

Classes#

KerasConvBackend()

Select Keras layers for square or hexagonal model backbones.

KerasSingleCNN(*args, **kwargs)

SingleCNN is a simple convolutional neural network model.

KerasResNet(*args, **kwargs)

ResNet is a residual neural network model.

KerasLoadedModel(*args, **kwargs)

LoadedModel is a pre-trained Keras model.

ctlearn.core.pytorch.model Module#

This module defines the CTLearnModel classes, which holds the basic functionality for creating a PyTorch model to be used in CTLearn.

Functions#

build_fully_connect_pytorch_head(...)

Build the fully connected head for the PyTorch-based CTLearn model.

Classes#

BasicBlock(in_channels, out_channels[, ...])

Basic block for ResNet architectures.

BottleneckBlock(in_channels, base_filters[, ...])

Bottleneck block for deeper ResNet architectures.

MultiFullyConnectedHead(heads_dict[, ...])

A PyTorch container module to hold the multi-task fully connected heads.

PyTorchConvBackend()

Select PyTorch layers for square or hexagonal model backbones.

PyTorchSingleCNN(*args, **kwargs)

SingleCNN is a simple convolutional neural network model implemented in PyTorch.

PyTorchResNet(*args, **kwargs)

PyTorchResNet is a residual neural network model implemented in PyTorch.

PyTorchLoadedModel(*args, **kwargs)

PyTorchLoadedModel is a pre-trained PyTorch model wrapper.

ctlearn.core.keras.attention Module#

This module defines the squeeze-excite blocks for channel-wise and/or spatial-wise attention mechanisms.

Functions#

dual_squeeze_excite_block(inputs[, ratio, name])

A channel & spatial (dual) squeeze-excite block.

channel_squeeze_excite_block(inputs[, ...])

A channel-wise squeeze-excite block.

spatial_squeeze_excite_block(inputs[, name])

A spatial squeeze-excite block.

ctlearn.core.pytorch.attention Module#

This module defines the squeeze-excite blocks for channel-wise and/or spatial-wise attention mechanisms in PyTorch.

Classes#

DualSqueezeExciteBlock(in_channels[, ratio])

A channel & spatial (dual) squeeze-excite block in PyTorch.

ChannelSqueezeExciteBlock(in_channels[, ratio])

A channel-wise squeeze-excite (cSE) block in PyTorch.

SpatialSqueezeExciteBlock(in_channels)

A spatial squeeze-excite (sSE) block in PyTorch.

ctlearn.core.keras.sequence Module#

Keras sequence for data loading.

Classes#

KerasSequence(DLDataReader, indices, tasks)

Generates batches for Keras application.

ctlearn.core.pytorch.dataset Module#

PyTorch dataset for data loading.

Classes#

PyTorchDataset(DLDataReader, indices, tasks)

Generates items/batches for PyTorch application based on DLDataReader.