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.

PROMPT = 'prompt'#
DEMOS = 'demos'#
INPUT = 'input'#
OUTPUT = 'output'#
HYPERPARAM = 'hyperparam'#
GRADIENT = 'gradient'#
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>, prompts: List[List[optim.types.PromptData]] = <factory>, step_results: List[optim.types.TrainerStepResult] = <factory>, effective_measure: Dict[str, Dict] = <factory>, validate_stats: optim.types.TrainerValidateStats = None, time_stamp: str = <factory>, trainer_state: Dict[str, Any] = None)[source]#

Bases: DataClass

steps: List[int]#
val_scores: List[float]#
test_scores: List[float]#
prompts: List[List[PromptData]]#
step_results: List[TrainerStepResult]#
effective_measure: Dict[str, Dict]#
validate_stats: TrainerValidateStats = None#
time_stamp: str#
trainer_state: Dict[str, Any] = None#