types

All data types used by Parameter, Optimizer, AdalComponent, and Trainer.

Classes

EvaluationResult([score, feedback])

A single evaluation of task pipeline response to a score in range [0, 1].

ParameterType(value[, names, module, ...])

Enum for the type of parameter to compute the loss with, and to inform the optimizer.

PromptData(id, name, data[, requires_opt])

TrainerResult(steps, val_scores, ...)

TrainerStepResult([step, val_score, ...])

TrainerValidateStats([max_score, min_score, ...])

A single evaluation of task pipeline response to a score in range [0, 1].

class ParameterType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enum for the type of parameter to compute the loss with, and to inform the optimizer.

The meaning of reach tuple is: 1. First element: the name of the parameter. 2. Second element: the description of the parameter. 3. Third element: whether the parameter is trainable.

To access each element, use the following: 1. name: ParameterType.PROMPT.value 2. description: ParameterType.PROMPT.description 3. trainable: ParameterType.PROMPT.default_trainable

PROMPT = 'prompt'
DEMOS = 'demos'
INPUT = 'input'
OUTPUT = 'output'
HYPERPARAM = 'hyperparam'
GENERATOR_OUTPUT = 'generator_output'
RETRIEVER_OUTPUT = 'retriever_output'
LOSS_OUTPUT = 'loss'
SUM_OUTPUT = 'sum'
NONE = 'none'
class EvaluationResult(score: float = 0.0, feedback: str = '')[source]

Bases: DataClass

A single evaluation of task pipeline response to a score in range [0, 1].

score: float = 0.0
feedback: str = ''
class PromptData(id: str, name: str, data: str, requires_opt: bool = True)[source]

Bases: object

id: str
name: str
data: str
requires_opt: bool = True
class TrainerStepResult(step: int = 0, val_score: float = None, test_score: float = None, attempted_val_score: float = None, prompt: List[optim.types.PromptData] = None)[source]

Bases: DataClass

step: int = 0
val_score: float = None
test_score: float = None
attempted_val_score: float = None
prompt: List[PromptData] = None
class TrainerValidateStats(max_score: float = 0.0, min_score: float = 0.0, mean_of_score: float = 0.0, std_of_score: float = 0.0)[source]

Bases: object

A single evaluation of task pipeline response to a score in range [0, 1].

max_score: float = 0.0
min_score: float = 0.0
mean_of_score: float = 0.0
std_of_score: float = 0.0
class TrainerResult(steps: List[int] = <factory>, val_scores: List[float] = <factory>, test_scores: List[float] = <factory>, step_results: List[optim.types.TrainerStepResult] = <factory>, effective_measure: Dict[str, Dict] = <factory>, validate_stats: optim.types.TrainerValidateStats = None, time_stamp: str = <factory>, total_time: float = 0.0, test_score: float = None, trainer_state: Dict[str, Any] = None)[source]

Bases: DataClass

steps: List[int]
val_scores: List[float]
test_scores: List[float]
step_results: List[TrainerStepResult]
effective_measure: Dict[str, Dict]
validate_stats: TrainerValidateStats = None
time_stamp: str
total_time: float = 0.0
test_score: float = None
trainer_state: Dict[str, Any] = None