Knowledgator Docs
GitHubDiscord
  • 🛎️Welcome
  • ⚙️Models
    • 🧮Comprehend-it
      • Comprehend_it-base
      • Comprehend_it-multilingual-t5-base
    • 🦎UTC
  • 👷Frameworks
    • 💧LiqFit
      • Quick Start
      • Benchmarks
      • API Reference
        • Collators
          • NLICollator
          • Creating custom collator
        • Datasets
          • NLIDataset
        • Losses
          • Focal Loss
          • Binary Cross Entropy
          • Cross Entropy Loss
        • Modeling
          • LiqFitBackbone
          • LiqFitModel
        • Downstream Heads
          • LiqFitHead
          • LabelClassificationHead
          • ClassClassificationHead
          • ClassificationHead
        • Pooling
          • GlobalMaxPooling1D
          • GlobalAbsAvgPooling1D
          • GlobalAbsMaxPooling1D
          • GlobalRMSPooling1D
          • GlobalSumPooling1D
          • GlobalAvgPooling1D
          • FirstTokenPooling1D
        • Models
          • Deberta
          • T5
        • Pipelines
          • ZeroShotClassificationPipeline
  • 📚Datasets
    • Biotech news dataset
  • 👩‍🔧Support
  • API Reference
    • Comprehend-it API
    • Entity extraction
      • /fast
      • /deterministic
      • /advanced
    • Token searcher
    • Web2Meaning
    • Web2Meaning2
    • Relation extraction
    • Text2Table
      • /web2text
      • /text_preprocessing
      • /text2table
      • /merge_tables
Powered by GitBook
On this page
  1. Frameworks
  2. LiqFit
  3. API Reference
  4. Pooling

GlobalAbsAvgPooling1D

Applies global absolute avg pooling for temporal data

class liqfit.modeling.pooling.GlobalAbsAvgPooling1D

forward(x: torch.Tensor, attention_mask: torch.Tensor)

Parameters:

  • x (torch.Tensor): Input tensor to apply pooling on. Expected shape: (B, T, E).

  • attention_mask (torch.Tensor): Mask tensor to mask out the padding while applying the pooling. Expected shape: (B, T)

Using GlobalAbsAvgPooling1D

from liqfit.modeling.pooling import GlobalAbsAvgPooling1D
import torch

x = torch.randn((1, 10, 20))
pooler = GlobalAbsAvgPooling1D()
out = pooler(x)
PreviousGlobalMaxPooling1DNextGlobalAbsMaxPooling1D

Last updated 1 year ago

👷
💧