def build_feed_forward(name,
                       hidden_dim,
                       activation,
                       trainable=True):
    """Get position-wise feed-forward layer builder.

    :param name: Prefix of names for internal layers.
    :param hidden_dim: Hidden dimension of feed forward layer.
    :param activation: Activation for feed-forward layer.
    :param trainable: Whether the layer is trainable.
    :return:
    """

    def _build_feed_forward(x):
        return FeedForward( units=hidden_dim,
                            activation=activation,
                            trainable=trainable,
                            name=name,)(x)

    return _build_feed_forward
Get position-wise feed-forward layer builder.

    :param name: Prefix of names for internal layers.
    :param hidden_dim: Hidden dimension of feed forward layer.
    :param activation: Activation for feed-forward layer.
    :param trainable: Whether the layer is trainable.
    :return:
    
keras_textclassification/keras_layers/transformer.py