Module: tfm.nlp.networks
Stay organized with collections
Save and categorize content based on your preferences.
Networks are combinations of tf.keras
layers (and possibly other networks).
They are tf.keras
models that would not be trained alone. It encapsulates
common network structures like a transformer encoder into an easily
handled object with a standardized configuration.
Classes
class AlbertEncoder
: ALBERT (https://arxiv.org/abs/1810.04805) text encoder network.
class BertEncoder
: Bi-directional Transformer-based encoder network.
class BertEncoderV2
: Bi-directional Transformer-based encoder network.
class Classification
: Classification network head for BERT modeling.
class EncoderScaffold
: Bi-directional Transformer-based encoder network scaffold.
class FNet
: FNet encoder network.
class FunnelTransformerEncoder
: Funnel Transformer-based encoder network.
class MobileBERTEncoder
: A Keras functional API implementation for MobileBERT encoder.
class PackedSequenceEmbedding
: An embedding network supporting packed sequences and position ids.
class SpanLabeling
: Span labeling network head for BERT modeling.
class SparseMixer
: Sparse Mixer encoder network.
class XLNetBase
: Base XLNet model.
class XLNetSpanLabeling
: Span labeling network head for XLNet on SQuAD2.0.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-02-02 UTC."],[],[],null,["# Module: tfm.nlp.networks\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/models/blob/v2.15.0/official/nlp/modeling/networks/__init__.py) |\n\nNetworks are combinations of [`tf.keras`](https://www.tensorflow.org/api_docs/python/tf/keras) layers (and possibly other networks).\n\nThey are [`tf.keras`](https://www.tensorflow.org/api_docs/python/tf/keras) models that would not be trained alone. It encapsulates\ncommon network structures like a transformer encoder into an easily\nhandled object with a standardized configuration.\n\nClasses\n-------\n\n[`class AlbertEncoder`](../../tfm/nlp/networks/AlbertEncoder): ALBERT (\u003chttps://arxiv.org/abs/1810.04805\u003e) text encoder network.\n\n[`class BertEncoder`](../../tfm/nlp/networks/BertEncoder): Bi-directional Transformer-based encoder network.\n\n[`class BertEncoderV2`](../../tfm/nlp/networks/BertEncoderV2): Bi-directional Transformer-based encoder network.\n\n[`class Classification`](../../tfm/nlp/networks/Classification): Classification network head for BERT modeling.\n\n[`class EncoderScaffold`](../../tfm/nlp/networks/EncoderScaffold): Bi-directional Transformer-based encoder network scaffold.\n\n[`class FNet`](../../tfm/nlp/networks/FNet): FNet encoder network.\n\n[`class FunnelTransformerEncoder`](../../tfm/nlp/networks/FunnelTransformerEncoder): Funnel Transformer-based encoder network.\n\n[`class MobileBERTEncoder`](../../tfm/nlp/networks/MobileBERTEncoder): A Keras functional API implementation for MobileBERT encoder.\n\n[`class PackedSequenceEmbedding`](../../tfm/nlp/networks/PackedSequenceEmbedding): An embedding network supporting packed sequences and position ids.\n\n[`class SpanLabeling`](../../tfm/nlp/networks/SpanLabeling): Span labeling network head for BERT modeling.\n\n[`class SparseMixer`](../../tfm/nlp/networks/SparseMixer): Sparse Mixer encoder network.\n\n[`class XLNetBase`](../../tfm/nlp/networks/XLNetBase): Base XLNet model.\n\n[`class XLNetSpanLabeling`](../../tfm/nlp/networks/XLNetSpanLabeling): Span labeling network head for XLNet on SQuAD2.0."]]