optimizers

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapFewShot

type BootstrapFewShot struct {
	Metric          func(example map[string]interface{}, prediction map[string]interface{}, ctx context.Context) bool
	MaxBootstrapped int
}

func NewBootstrapFewShot

func NewBootstrapFewShot(metric func(example map[string]interface{}, prediction map[string]interface{}, ctx context.Context) bool, maxBootstrapped int) *BootstrapFewShot

func (*BootstrapFewShot) Compile

func (b *BootstrapFewShot) Compile(ctx context.Context, student, teacher core.Program, trainset []map[string]interface{}) (core.Program, error)

type Copro added in v0.1.0

type Copro struct {
	Metric          func(example, prediction map[string]interface{}, ctx context.Context) bool
	MaxBootstrapped int
	SubOptimizer    core.Optimizer
}

func NewCopro added in v0.1.0

func NewCopro(metric func(example, prediction map[string]interface{}, ctx context.Context) bool, maxBootstrapped int, subOptimizer core.Optimizer) *Copro

func (*Copro) Compile added in v0.1.0

func (c *Copro) Compile(ctx context.Context, program core.Program, dataset core.Dataset, metric core.Metric) (core.Program, error)

type MIPRO added in v0.1.0

type MIPRO struct {
	Metric               func(example, prediction map[string]interface{}, ctx context.Context) float64
	NumCandidates        int
	MaxBootstrappedDemos int
	MaxLabeledDemos      int
	NumTrials            int
	PromptModel          core.LLM
	TaskModel            core.LLM
	MiniBatchSize        int
	FullEvalSteps        int
	Verbose              bool
}

func NewMIPRO added in v0.1.0

func NewMIPRO(metric func(example, prediction map[string]interface{}, ctx context.Context) float64, opts ...MIPROOption) *MIPRO

func (*MIPRO) Compile added in v0.1.0

func (m *MIPRO) Compile(ctx context.Context, program core.Program, dataset core.Dataset, metric core.Metric) (core.Program, error)

type MIPROOption added in v0.1.0

type MIPROOption func(*MIPRO)

func WithFullEvalSteps added in v0.1.0

func WithFullEvalSteps(n int) MIPROOption

func WithMaxBootstrappedDemos added in v0.1.0

func WithMaxBootstrappedDemos(n int) MIPROOption

func WithMaxLabeledDemos added in v0.1.0

func WithMaxLabeledDemos(n int) MIPROOption

func WithMiniBatchSize added in v0.1.0

func WithMiniBatchSize(n int) MIPROOption

func WithNumCandidates added in v0.1.0

func WithNumCandidates(n int) MIPROOption

func WithNumTrials added in v0.1.0

func WithNumTrials(n int) MIPROOption

func WithPromptModel added in v0.1.0

func WithPromptModel(model core.LLM) MIPROOption

func WithTaskModel added in v0.1.0

func WithTaskModel(model core.LLM) MIPROOption

func WithVerbose added in v0.1.0

func WithVerbose(v bool) MIPROOption

type Trial added in v0.1.0

type Trial struct {
	Params map[string]int
	Score  float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL