RandomFewShot
RandomFewShot
Bases: Optimizer
Select randomly the best predictions to populate the LM's prompt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
int
|
The number of examples to select (default 3) among the best predictions. |
3
|
k_best
|
int
|
The max number of best predictions to select from (default 10). |
10
|
Returns:
Type | Description |
---|---|
Optimizer
|
The created optimizer. |
Source code in synalinks/src/optimizers/random_few_shot.py
finalize(trainable_variable)
async
Finalize the optimization of a single variable (cleanup/scaling etc.).
optimize(trainable_variable, reward=None)
async
Perform a backprop/optimization on a single variable.