logitorch.pl_models.prover ========================== .. py:module:: logitorch.pl_models.prover Classes ------- .. autoapisummary:: logitorch.pl_models.prover.PLPRover Module Contents --------------- .. py:class:: PLPRover(pretrained_model: str = 'roberta-base', learning_rate: float = 1e-05, weight_decay: float = 0.1, num_labels: int = 2) Bases: :py:obj:`lightning.pytorch.LightningModule` PyTorch Lightning module for the PRover model. Args: pretrained_model (str): Name of the pretrained model to use. Default is "roberta-base". learning_rate (float): Learning rate for the optimizer. Default is 1e-5. weight_decay (float): Weight decay for the optimizer. Default is 0.1. num_labels (int): Number of labels for the model. Default is 2. .. py:method:: configure_optimizers() Configure the optimizer and scheduler for training. Returns: Tuple of optimizer and scheduler. .. py:method:: forward(x, proof_offsets=None, node_labels=None, edge_labels=None, qa_labels=None, device: str = 'cpu') Forward pass of the PLPRover model. Args: x: Input data. proof_offsets: Proof offsets. node_labels: Node labels. edge_labels: Edge labels. qa_labels: QA labels. device (str): Device to use for computation. Default is "cpu". Returns: Output of the model. .. py:method:: predict(triples, rules, question, device: str = 'cpu') Make predictions using the PLPRover model. Args: triples: Triples data. rules: Rules data. question: Question data. device (str): Device to use for computation. Default is "cpu". Returns: Predicted output. .. py:method:: training_step(train_batch: Tuple[Dict[str, torch.Tensor], torch.Tensor], batch_idx: int) -> torch.Tensor Training step for the PLPRover model. Args: train_batch: Batch of training data. batch_idx: Index of the batch. Returns: Loss value. .. py:method:: validation_step(val_batch: Tuple[Dict[str, torch.Tensor], torch.Tensor], batch_idx: int) -> None Validation step for the PLPRover model. Args: val_batch: Batch of validation data. batch_idx: Index of the batch. .. py:attribute:: learning_rate :value: 1e-05 .. py:attribute:: model .. py:attribute:: pretrained_model :value: 'roberta-base' .. py:attribute:: weight_decay :value: 0.1