sweep

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sweep runs an eval harness over a matrix of memmy configs to find a parameter setting that scores best on a labeled query set.

A sweep YAML file looks like:

base: configs/baseline.yaml      # optional path
matrix:
  - name: low-decay
    overrides:
      NodeLambda: 4.0e-8
  - name: high-reinforce
    overrides:
      NodeDelta: 2.5

Each entry produces a fresh memmy db, runs the same query battery, and writes per-config metrics under runs/<sweep_id>/<config_name>/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyServiceOverrides

func ApplyServiceOverrides(base memmy.ServiceConfig, overrides map[string]any) (memmy.ServiceConfig, error)

ApplyServiceOverrides starts from a base ServiceConfig and applies the overrides map by JSON-marshalling the base, merging the overrides into the resulting object, then unmarshalling back. This keeps the sweep YAML free of typed knowledge of every field while still type-checking via the ServiceConfig schema on the way back.

Types

type Entry

type Entry struct {
	Name      string         `yaml:"name"`
	Overrides map[string]any `yaml:"overrides"`
}

Entry is one configuration to sweep over. Overrides are applied over the loaded ServiceConfig via sweep.ApplyServiceOverrides.

type Matrix

type Matrix struct {
	Base    string  `yaml:"base"`
	Entries []Entry `yaml:"matrix"`
}

Matrix is the loaded sweep YAML.

func Load

func Load(path string) (Matrix, error)

Load reads a sweep YAML.

Jump to

Keyboard shortcuts

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