crested.tl.zoo.legnet

Contents

crested.tl.zoo.legnet#

crested.tl.zoo.legnet(seq_len, num_classes, stem_filters=64, stem_kernel_size=5, eff_kernel_size=3, tower_filters=(80, 96, 112, 128), pool_sizes=(2, 2, 2, 2), resize_factor=4, activation='swish', output_activation='softplus', name='LegNet')#

Build a model with efficientnetv2-like blocks, inspired by human_legnet/MPRALegNet (Agarwal et al. 2025, 10.1038/s41586-024-08430-9, github.com/autosome-ru/human_legnet).

For the original implementation and the trained MPRALegNet models, please see github.com/autosome-ru/human_legnet.

Parameters:
  • seq_len (int) – Width of the input region.

  • num_classes (int) – Number of classes to predict.

  • stem_filters (int (default: 64)) – Number of convolution filters in the stem.

  • stem_kernel_size (int (default: 5)) – Kernel size for the stem.

  • eff_kernel_size (int (default: 3)) – Kernel size for EfficientNet blocks.

  • tower_filters (Sequence[int] (default: (80, 96, 112, 128))) – List of output filters for each stage in the convolution tower.

  • pool_sizes (Sequence[int] (default: (2, 2, 2, 2))) – List of pooling sizes for each stage.

  • resize_factor (int (default: 4)) – Expansion factor for inverted residual blocks.

  • activation (str (default: 'swish')) – Activation function. The default is “swish”.

  • output_activation (str (default: 'softplus')) – Activation function for the output layer.

  • name (str | None (default: 'LegNet')) – Model name.

Returns:

keras.Model Compiled LegNet model.