tl.zoo.utils#
Model blocks, utility functions and custom layers for model building.
Classes
AttentionPool from the FastISM repository. |
|
Creates a MultiheadAttention module. |
Functions
|
Apply activation function to a tensor. |
|
Convolution building block. |
|
Construct a convolution block (for Basenji/Enformer). |
|
Dense building block. |
|
Construct a residual dilated convolution block. |
|
Construct a feedforward block (for Enformer), consisting of Residual(LayerNorm+PointwiseConv+Dropout+ReLU+PointwiseConv+Dropout). |
|
Wrap around keras.activations.gelu with approximate = True. |
|
Very simple gelu approximation, used in Enformer, so needed to get equivalent results. |
|
Pass input layer through hidden layers. |
|
Construct a MHA block (for Enformer/Borzoi), consisting of Residual(LayerNorm+MHSelfAttention+Dropout). |
|
Apply activation function to a tensor. |