Skip to main content

classy.pl_modules.hf.classification

Classes​

HFQAPLModule​

class HFQAPLModule()

Simple Mixin to model the prediction behavior of a classy.pl_modules.base.ClassyPLModule.

__init__​

def __init__(
    transformer_model: str,
    optim_conf: omegaconf.dictconfig.DictConfig,
    additional_special_tokens: Optional[List[str]] = None,
)

test_step​

def test_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> None

training_step​

def training_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> torch.Tensor

validation_step​

def validation_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> None

HFSentencePairPLModule​

class HFSentencePairPLModule()

Simple Mixin to model the prediction behavior of a classy.pl_modules.base.ClassyPLModule.

__init__​

def __init__(
    transformer_model: str,
    vocabulary: Vocabulary,
    optim_conf: omegaconf.dictconfig.DictConfig,
    additional_special_tokens: Optional[List[str]] = None,
)

HFSequenceCommonPLModule​

class HFSequenceCommonPLModule()

Simple Mixin to model the prediction behavior of a classy.pl_modules.base.ClassyPLModule.

Subclasses (2)

__init__​

def __init__(
    transformer_model: str,
    vocabulary: Vocabulary,
    optim_conf: omegaconf.dictconfig.DictConfig,
    additional_special_tokens: Optional[List[str]] = None,
)

test_step​

def test_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> None

training_step​

def training_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> torch.Tensor

validation_step​

def validation_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> None

HFSequencePLModule​

class HFSequencePLModule()

Simple Mixin to model the prediction behavior of a classy.pl_modules.base.ClassyPLModule.

__init__​

def __init__(
    transformer_model: str,
    vocabulary: Vocabulary,
    optim_conf: omegaconf.dictconfig.DictConfig,
    additional_special_tokens: Optional[List[str]] = None,
)

HFTokensPLModule​

class HFTokensPLModule()

Simple Mixin to model the prediction behavior of a classy.pl_modules.base.ClassyPLModule.

__init__​

def __init__(
    transformer_model: str,
    use_last_n_layers: int,
    fine_tune: bool,
    vocabulary: Vocabulary,
    optim_conf: omegaconf.dictconfig.DictConfig,
    additional_special_tokens: Optional[List[str]] = None,
)

test_step​

def test_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> None

training_step​

def training_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> torch.Tensor

validation_step​

def validation_step(
    self,
    batch: dict,
    batch_idx: int,
) ‑> None