You can define custom tokenizer stacks by composing supported Keras layers directly in the tokenizer.blocks section of your YAML config. This requires no code changes.
Supported Layers include:
Conv2DMaxPooling2DDepthwiseConv2DSqueezeExciteBatchNormalizationMaxBlurPooling2DCoordConv2D- (And many others listed in the Model Schema reference)
Each layer entry accepts the full set of corresponding Keras parameters (e.g., filters, kernel_size, strides, activation). For export-friendly models, it is recommended to use relu activations.
tokenizer:
blocks:
- { layer: Conv2D, filters: 64, kernel_size: 3, activation: relu }
- { layer: SqueezeExcite, ratio: 0.5 }
- { layer: DepthwiseConv2D, kernel_size: 3, strides: 1 }
- { layer: BatchNormalization }
- { layer: MaxBlurPooling2D, pool_size: 2, filter_size: 3 }
- { layer: Conv2D, filters: 128, kernel_size: 3 }
- { layer: CoordConv2D, filters: 96, kernel_size: 3, with_r: true }