API Reference
This reference is automatically generated from the docstrings in the source code.
Only the symbols listed in Stability and versioning
and frozen under tests/compatibility/v1_0_0/ are stable for the 1.x series.
Other importable or documented modules are experimental or internal as labelled.
Unified API
The primary user-facing entry points. Most users only need these.
vamos.experiment.unified
Unified API for VAMOS optimization.
This module provides a single, powerful entry point that consolidates problem-based runs, study-style configuration, and auto-parameter defaults into one flexible function.
optimize(problem, *, algorithm='auto', max_evaluations=None, termination=None, pop_size=None, engine=None, seed=DEFAULT_SEED, verbose=False, n_var=None, n_obj=None, problem_kwargs=None, algorithm_config=None, eval_strategy=None, live_viz=None, checkpoint=None)
optimize(problem: str | ProblemProtocol, *, algorithm: AlgorithmName | str = 'auto', max_evaluations: int | None = None, termination: TerminationSpec | None = None, pop_size: int | None = None, engine: EngineName | str | None = None, seed: int | None = 42, verbose: bool = False, n_var: int | None = None, n_obj: int | None = None, problem_kwargs: Mapping[str, object] | None = None, algorithm_config: AlgorithmConfigProtocol | None = None, eval_strategy: EvaluationBackend | str | None = None, live_viz: LiveVisualization | None = None, checkpoint: CheckpointPayload | None = None) -> OptimizationResult
optimize(problem: str | ProblemProtocol, *, algorithm: AlgorithmName | str = 'auto', max_evaluations: int | None = None, termination: TerminationSpec | None = None, pop_size: int | None = None, engine: EngineName | str | None = None, seed: list[int] | tuple[int, ...], verbose: bool = False, n_var: int | None = None, n_obj: int | None = None, problem_kwargs: Mapping[str, object] | None = None, algorithm_config: AlgorithmConfigProtocol | None = None, eval_strategy: EvaluationBackend | str | None = None, live_viz: LiveVisualization | None = None, checkpoint: CheckpointPayload | None = None) -> StudyResult
Unified entry point for VAMOS optimization.
This function consolidates multiple APIs into a single powerful interface: - Accepts problem names (strings) or instances - Supports AutoML with algorithm="auto" - Handles multi-run studies with seed=[0,1,2,...] - Prefer optimize(...) for all runs (explicit options are available).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
problem
|
str | ProblemProtocol
|
Problem name (for registered problems) or a problem instance. |
required |
algorithm
|
AlgorithmName | str
|
Algorithm name or |
"auto"
|
max_evaluations
|
int | None
|
Maximum function evaluations. Auto-determined when omitted. |
None
|
termination
|
TerminationSpec | None
|
Explicit termination pair for advanced runs that also pass
|
None
|
pop_size
|
int | None
|
Population size. Auto-determined when omitted. |
None
|
engine
|
EngineName | str | None
|
Backend engine (for example |
None
|
seed
|
int | None | list[int] | tuple[int, ...]
|
Random seed for one run, |
``42``
|
verbose
|
bool
|
Enable VAMOS logging for the run. |
``False``
|
n_var
|
int | None
|
Override problem dimensions when using a registered string problem key. |
None
|
n_obj
|
int | None
|
Override problem dimensions when using a registered string problem key. |
None
|
problem_kwargs
|
Mapping[str, object] | None
|
Extra keyword arguments forwarded to problem instantiation. |
None
|
algorithm_config
|
AlgorithmConfigProtocol | None
|
Explicit algorithm config object. |
None
|
eval_strategy
|
EvaluationBackend | str | None
|
Evaluation backend name or backend instance. |
None
|
live_viz
|
LiveVisualization | None
|
Live visualization callback. |
None
|
checkpoint
|
CheckpointPayload | None
|
Warm-start checkpoint for compatible algorithms. Multi-seed runs do not accept checkpoints. |
None
|
Returns:
| Type | Description |
|---|---|
OptimizationResult | StudyResult
|
A single-run result for scalar |
Raises:
| Type | Description |
|---|---|
ConfigurationError
|
If inputs are invalid or the algorithm/engine combination is not supported. |
Examples:
|
AutoML mode - zero config
Specify algorithm
Multi-seed study
|
Source code in src/vamos/experiment/unified.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | |
Problem Definition
vamos.foundation.problem.base
Base class for class-based custom optimization problems.
Problem
Base class for class-based custom optimization problems.
Subclass this when your problem needs state — a dataset, distance matrix,
simulator, or any data set up in __init__.
Required: set n_var, n_obj, xl, xu in __init__.
Optional: override encoding and n_constraints as class-level
attributes (not in __init__).
Example — unconstrained::
import numpy as np
from vamos import Problem, optimize
class MyProblem(Problem):
def __init__(self):
self.n_var = 3
self.n_obj = 2
self.xl = np.zeros(3)
self.xu = np.ones(3)
def objectives(self, X: np.ndarray) -> np.ndarray:
# X: (N, n_var) batch of candidate solutions
f1 = np.sum(X ** 2, axis=1)
f2 = np.sum((X - 1) ** 2, axis=1)
return np.column_stack([f1, f2])
result = optimize(MyProblem(), algorithm="nsgaii", max_evaluations=5000)
Example — constrained::
class MyConstrainedProblem(Problem):
n_constraints = 1 # declare at class level
def __init__(self):
self.n_var = 3
self.n_obj = 2
self.xl = np.zeros(3)
self.xu = np.ones(3)
def objectives(self, X):
f1 = np.sum(X ** 2, axis=1)
f2 = np.sum((X - 1) ** 2, axis=1)
return np.column_stack([f1, f2])
def constraints(self, X):
# Sign convention: g(x) <= 0 means feasible.
g = np.sum(X, axis=1) - 2.0 # sum(x) <= 2
return g.reshape(-1, 1)
Source code in src/vamos/foundation/problem/base.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
encoding = 'real'
class-attribute
instance-attribute
Variable encoding. Supported values: "real", "integer",
"binary", "permutation", "mixed". Default: "real".
n_constraints = 0
class-attribute
instance-attribute
Number of inequality constraints. Default: 0 (unconstrained).
constraints(X)
Compute constraint violations for a batch of solutions.
Override this method when your problem has inequality constraints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Decision matrix of shape |
required |
Returns:
| Type | Description |
|---|---|
ndarray | None
|
Constraint array of shape |
Source code in src/vamos/foundation/problem/base.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
evaluate(X, out)
Framework evaluation entry point. Override :meth:objectives
(and optionally :meth:constraints) instead of this method.
Source code in src/vamos/foundation/problem/base.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
objectives(X)
Compute objective values for a batch of solutions.
Override this method in your subclass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Decision matrix of shape |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Objective array of shape |
Source code in src/vamos/foundation/problem/base.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
vamos.foundation.problem.builder
Friendly problem builder for VAMOS.
Provides make_problem() -- the simplest way to turn a plain Python
function into a fully compatible VAMOS problem, ready for optimize().
Example
from vamos import make_problem, optimize problem = make_problem( ... lambda x: [x[0], 1 - x[0] ** 0.5], ... n_var=2, n_obj=2, ... bounds=[(0, 1), (0, 1)], ... encoding="real", ... ) result = optimize(problem, algorithm="nsgaii", max_evaluations=2000)
FunctionalProblem
Bases: Problem
Problem wrapper that adapts a user function to the VAMOS ProblemProtocol.
Created via :func:make_problem -- users should not instantiate this
directly.
Source code in src/vamos/foundation/problem/builder.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
evaluate(X, out)
Evaluate the objective (and optional constraint) functions.
Source code in src/vamos/foundation/problem/builder.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
make_problem(fn, *, n_var, n_obj, bounds=None, xl=None, xu=None, vectorized=False, encoding, name=None, constraints=None, n_constraints=0)
Create a VAMOS-compatible problem from a plain Python function.
This is the friendliest way to define a custom optimization problem. Your function receives decision variables and returns objective values -- VAMOS handles bounds, protocol adaptation, and optional batched execution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn
|
callable
|
Objective function.
|
required |
n_var
|
int
|
Number of decision variables. |
required |
n_obj
|
int
|
Number of objectives to minimize. |
required |
bounds
|
sequence of (lower, upper) tuples
|
Per-variable bounds, e.g. |
None
|
xl
|
float or array - like
|
Lower / upper bounds for all variables. A scalar applies the same bound to every variable. Mutually exclusive with bounds. |
None
|
xu
|
float or array - like
|
Lower / upper bounds for all variables. A scalar applies the same bound to every variable. Mutually exclusive with bounds. |
None
|
vectorized
|
bool
|
If |
False
|
encoding
|
str
|
Variable encoding: |
required |
name
|
str
|
Human-readable name shown in logs and results. Defaults to the function name. |
None
|
constraints
|
callable
|
Constraint function following the same signature convention as
fn. Must return |
None
|
n_constraints
|
int
|
Number of constraint values. Required when constraints is provided. |
0
|
Returns:
| Type | Description |
|---|---|
FunctionalProblem
|
A problem object ready to pass to |
Raises:
| Type | Description |
|---|---|
TypeError
|
If fn is not callable. |
ValueError
|
If bounds and xl/xu are both provided, if bounds length does not match n_var, or if n_constraints > 0 but no constraints callable is given. |
Examples:
Minimal two-objective problem::
from vamos import make_problem, optimize
problem = make_problem(
lambda x: [x[0], 1 - x[0] ** 0.5],
n_var=2, n_obj=2,
bounds=[(0, 1), (0, 1)],
encoding="real",
)
result = optimize(problem, algorithm="nsgaii", max_evaluations=2000)
Vectorized for better performance::
import numpy as np
def my_objectives(X):
f1 = X[:, 0]
f2 = 1 - np.sqrt(X[:, 0])
return np.column_stack([f1, f2])
problem = make_problem(
my_objectives,
n_var=2, n_obj=2,
bounds=[(0, 1), (0, 1)],
vectorized=True,
encoding="real",
)
With constraints (g(x) <= 0 is feasible)::
problem = make_problem(
lambda x: [x[0] + x[1], x[0] * x[1]],
n_var=2, n_obj=2,
bounds=[(0, 5), (0, 5)],
encoding="real",
constraints=lambda x: [x[0] + x[1] - 4],
n_constraints=1,
)
Source code in src/vamos/foundation/problem/builder.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
vamos.foundation.problem.types
Results
vamos.experiment.optimization_result
Public optimization result types and helpers.
OptimizationResult
Container returned by optimize() with Pareto front data and selection helpers.
Use vamos.ux.api for summaries, plotting, and export helpers.
Source code in src/vamos/experiment/optimization_result/model.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
manifest
property
Immutable source manifest when this result was loaded from a run.
StudyResult
Bases: Sequence[OptimizationResult]
Container returned by optimize(..., seed=[...]).
The object behaves like a read-only sequence of :class:OptimizationResult
while also exposing light-weight aggregation helpers for numeric metrics.
Source code in src/vamos/experiment/optimization_result/study.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
runs
property
Return the underlying immutable run collection.
best_run(name, maximize=True)
Return the run with the best value for the named metric.
Source code in src/vamos/experiment/optimization_result/study.py
101 102 103 104 105 106 107 | |
mean(name)
Return the mean of a numeric metric across runs.
Source code in src/vamos/experiment/optimization_result/study.py
87 88 89 90 91 92 | |
metric_values(name)
Return a float array with the named metric extracted from each run.
Source code in src/vamos/experiment/optimization_result/study.py
81 82 83 84 85 | |
std(name)
Return the population standard deviation of a numeric metric across runs.
Source code in src/vamos/experiment/optimization_result/study.py
94 95 96 97 98 99 | |
Run artifacts
The top-level persistence, verification, and exact built-in replay functions delegate to this facade. Loading and verification are data-only; replay is the separate explicit executable operation.
vamos.run_artifacts
Layer-neutral public bridge for canonical run-artifact operations.
StoredRun
dataclass
Immutable data-only handle with lazy, side-effect-free artifact access.
Source code in src/vamos/experiment/artifacts/models.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
environment
cached
property
Load and cache the immutable captured environment document.
result
cached
property
Load and cache the canonical result bundle without executing code.
RunManifest
dataclass
Bases: Mapping[str, Any]
Immutable validated envelope for one v1 execution attempt.
Source code in src/vamos/experiment/artifacts/models.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
artifact(role)
Return the singleton descriptor for role when present.
Source code in src/vamos/experiment/artifacts/models.py
168 169 170 171 172 173 | |
LoadLimits
dataclass
Finite defensive limits used by trusted v1 readers.
Callers may pass a different instance explicitly when they trust a larger artifact. Normal loading never increases these limits automatically.
Source code in src/vamos/experiment/artifacts/models.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
CompatibilityReport
dataclass
Material compatibility of a stored run with the current runtime.
Source code in src/vamos/experiment/artifacts/reports.py
41 42 43 44 45 46 47 48 49 50 51 52 53 | |
VerificationReport
dataclass
Independent verification dimensions for one canonical run.
Source code in src/vamos/experiment/artifacts/reports.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
ReplayReport
dataclass
Outcome and evidence for a newly stored replay attempt.
Source code in src/vamos/experiment/artifacts/reports.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
save_result(result, path, *, requested_spec=None, resolved_spec=None, labels=None, limits=None)
Persist a result as one immutable, relocatable v1 run directory.
Source code in src/vamos/experiment/artifacts/persistence.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
load_run(path, *, verify='required', limits=None)
Load immutable manifest access without resolving or executing code.
Source code in src/vamos/experiment/artifacts/persistence.py
232 233 234 235 236 237 238 239 240 | |
load_result(path, *, verify='required', limits=None)
Load the canonical numerical result; this never reruns optimization.
Source code in src/vamos/experiment/artifacts/persistence.py
243 244 245 246 247 248 249 250 | |
verify_run(path, *, require_level=None, limits=None)
Fully verify a canonical run without executing or resolving code.
Source code in src/vamos/experiment/artifacts/verification.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
reproduce(path, *, output=None, limits=None)
Verify, exactly execute, compare, and store a new built-in replay.
Source code in src/vamos/experiment/artifacts/replay.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
Durable studies
The top-level StudySpec, plan_study, create_study, and load_study entry
points resolve, publish, and verify durable studies. Creation performs no
optimization, loading is data-only, and report/summary models remain available
through the focused vamos.study_artifacts facade.
vamos.study_artifacts
Layer-neutral public bridge for canonical StudyManifest operations.
StudySpec
dataclass
Validated, immutable user intent for a deterministic study plan.
Seeds are explicit. All defaults selected during creation are frozen into each task's resolved run specification before publication.
Source code in src/vamos/experiment/study/models.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
as_intent_dict()
Return a detached JSON representation without document identity.
Source code in src/vamos/experiment/study/models.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
StudyPlanReport
dataclass
Immutable explanation of a resolved study with no published state.
Source code in src/vamos/experiment/study/preflight.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
as_dict()
Return a detached semantic payload for Python and CLI consumers.
Source code in src/vamos/experiment/study/preflight.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
Study
dataclass
Immutable, data-only handle for a verified persisted study.
Source code in src/vamos/experiment/study/models.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
cancel()
Cancel this study or request cancellation from its local runner.
Source code in src/vamos/experiment/study/models.py
323 324 325 326 327 | |
inspect()
Reload and project current durable state without modifying it.
Source code in src/vamos/experiment/study/models.py
341 342 343 344 345 | |
resume(*, retry_failed=False)
Reconcile this study and execute its eligible unfinished tasks.
Source code in src/vamos/experiment/study/models.py
329 330 331 332 333 | |
retry(*, failed_only=True)
Explicitly retry eligible terminal attempts without changing the plan.
Source code in src/vamos/experiment/study/models.py
335 336 337 338 339 | |
run()
Execute this newly created durable study sequentially.
Source code in src/vamos/experiment/study/models.py
317 318 319 320 321 | |
summarize()
Return a deterministic in-memory summary without writing files.
Source code in src/vamos/experiment/study/models.py
347 348 349 350 351 | |
StudyLoadLimits
dataclass
Source code in src/vamos/experiment/study/limits.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
StudyReport
dataclass
Deterministic current-state report for one canonical study.
Source code in src/vamos/experiment/study/report_models.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
StudySummary
dataclass
Deterministic, derived, in-memory summary of every planned task.
Source code in src/vamos/experiment/study/report_models.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
plan_study(spec, *, output=None)
Resolve and explain spec without creating a study or running a task.
Source code in src/vamos/experiment/study/preflight.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
create_study(spec, *, output, limits=None)
Resolve and atomically publish a study without executing any task.
Source code in src/vamos/experiment/study/creation.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
load_study(path, *, limits=None)
Load and fully verify one canonical study without executing code.
Source code in src/vamos/experiment/study/loading.py
57 58 59 | |
Algorithm Configuration
vamos.engine.algorithm.config.nsgaii
NSGA-II configuration.
NSGAIIConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/nsgaii.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
default(pop_size=100, n_var=None, encoding=None)
classmethod
Create a default NSGA-II configuration with sensible defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pop_size
|
int
|
Population size. |
100
|
n_var
|
int | None
|
Number of variables used for the default mutation probability. |
None
|
encoding
|
str | None
|
Problem encoding. If omitted, defaults to |
None
|
Returns:
| Type | Description |
|---|---|
NSGAIIConfig
|
Frozen configuration ready to use. |
Source code in src/vamos/engine/algorithm/config/nsgaii.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
_NSGAIIConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _SelectionBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ResultArchiveBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder
Fluent builder for NSGA-II configs.
Source code in src/vamos/engine/algorithm/config/nsgaii.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
steady_state(enabled=True)
Enable steady-state mode (incremental replacement).
Source code in src/vamos/engine/algorithm/config/nsgaii.py
56 57 58 59 | |
vamos.engine.algorithm.config.moead
MOEA/D configuration.
MOEADConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/moead.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
default(pop_size=None, n_var=None, n_obj=3)
classmethod
Create a default MOEA/D configuration with sensible defaults.
Source code in src/vamos/engine/algorithm/config/moead.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
_MOEADConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for MOEA/D settings.
Examples: # Fluent builder cfg = MOEADConfig.builder().pop_size(100).neighbor_size(20).build()
# Quick default configuration
cfg = MOEADConfig.default()
Source code in src/vamos/engine/algorithm/config/moead.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
vamos.engine.algorithm.config.nsgaiii
NSGA-III configuration.
NSGAIIIConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/nsgaiii.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
default(pop_size=None, n_var=None, n_obj=3)
classmethod
Create a default NSGA-III configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pop_size
|
int | None
|
Population size. Defaults to the generated reference-direction count. |
None
|
n_var
|
int | None
|
Number of variables used for the default mutation probability. |
None
|
n_obj
|
int
|
Number of objectives used to choose the default reference directions. |
3
|
Source code in src/vamos/engine/algorithm/config/nsgaiii.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
_NSGAIIIConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _SelectionBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ResultArchiveBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder
Declarative configuration holder for NSGA-III settings.
Examples: cfg = NSGAIIIConfig.default(n_obj=3) cfg = NSGAIIIConfig.builder().pop_size(92).crossover("sbx", prob=1.0).build()
Source code in src/vamos/engine/algorithm/config/nsgaiii.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
vamos.engine.algorithm.config.smsemoa
SMS-EMOA configuration.
SMSEMOAConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/smsemoa.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
default(pop_size=100, n_var=None)
classmethod
Create a default SMS-EMOA configuration.
Source code in src/vamos/engine/algorithm/config/smsemoa.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
_SMSEMOAConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _SelectionBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for SMS-EMOA settings.
Examples: cfg = SMSEMOAConfig.default() cfg = SMSEMOAConfig.builder().pop_size(100).crossover("sbx", prob=1.0).build()
Source code in src/vamos/engine/algorithm/config/smsemoa.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
vamos.engine.algorithm.config.spea2
SPEA2 configuration.
SPEA2Config
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/spea2.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
default(pop_size=100, n_var=None)
classmethod
Create a default SPEA2 configuration.
Source code in src/vamos/engine/algorithm/config/spea2.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
_SPEA2ConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _SelectionBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for SPEA2 settings.
Examples: cfg = SPEA2Config.default() cfg = SPEA2Config.builder().pop_size(100).archive_size(100).build()
Source code in src/vamos/engine/algorithm/config/spea2.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
external_archive(capacity=None, **kwargs)
Configure an external archive for result storage.
Note
This is separate from archive_size, which controls the internal SPEA2 archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capacity
|
int | None
|
Maximum number of solutions. |
None
|
**kwargs
|
Any
|
Forwarded to :class: |
{}
|
Source code in src/vamos/engine/algorithm/config/spea2.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
vamos.engine.algorithm.config.ibea
IBEA configuration.
IBEAConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/ibea.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
default(pop_size=100, n_var=None)
classmethod
Create a default IBEA configuration.
Source code in src/vamos/engine/algorithm/config/ibea.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
_IBEAConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _SelectionBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for IBEA settings.
Source code in src/vamos/engine/algorithm/config/ibea.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
vamos.engine.algorithm.config.smpso
SMPSO configuration.
SMPSOConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/smpso.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
default(pop_size=100, n_var=None)
classmethod
Create a default SMPSO configuration.
Source code in src/vamos/engine/algorithm/config/smpso.py
45 46 47 48 49 50 51 52 53 | |
_SMPSOConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _MutationBuilder, _RepairBuilder, _InitializerBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for SMPSO settings.
Source code in src/vamos/engine/algorithm/config/smpso.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
external_archive(capacity=None, **kwargs)
Configure an external archive for result storage.
Note
This is separate from archive_size, which controls the internal SMPSO archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capacity
|
int | None
|
Maximum number of solutions. |
None
|
**kwargs
|
Any
|
Forwarded to :class: |
{}
|
Source code in src/vamos/engine/algorithm/config/smpso.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
vamos.engine.algorithm.config.agemoea
AGE-MOEA configuration.
AGEMOEAConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/agemoea.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
default(pop_size=100, n_var=None)
classmethod
Create a default AGE-MOEA configuration.
Source code in src/vamos/engine/algorithm/config/agemoea.py
80 81 82 83 84 85 86 87 88 | |
_AGEMOEAConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Fluent builder for AGE-MOEA configs.
Source code in src/vamos/engine/algorithm/config/agemoea.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
vamos.engine.algorithm.config.rvea
RVEA configuration.
RVEAConfig
dataclass
Bases: _SerializableConfig
Source code in src/vamos/engine/algorithm/config/rvea.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
default(pop_size=None, n_var=None, n_obj=3)
classmethod
Create a default RVEA configuration.
Source code in src/vamos/engine/algorithm/config/rvea.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
_RVEAConfigBuilder
Bases: _ConfigBuilderState, _PopSizeBuilder, _CrossoverBuilder, _MutationBuilder, _RepairBuilder, _InitializerBuilder, _MutationProbFactorBuilder, _ConstraintModeBuilder, _TrackGenealogyBuilder, _ResultArchiveBuilder
Declarative configuration holder for RVEA settings.
Examples: cfg = RVEAConfig.default() cfg = RVEAConfig.builder().pop_size(100).n_partitions(12).build()
Source code in src/vamos/engine/algorithm/config/rvea.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
vamos.engine.algorithm.config.generic
GenericAlgorithmConfig
dataclass
Minimal config wrapper for plugin/custom algorithms.
This exists to keep the public-facing APIs strongly typed while still allowing users (or tests) to pass a free-form mapping when integrating a third-party algorithm via the algorithm registry.
Source code in src/vamos/engine/algorithm/config/generic.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Constraint Handling
vamos.foundation.constraints
ConstraintInfo
dataclass
Source code in src/vamos/foundation/constraints/__init__.py
12 13 14 15 16 | |
FeasibilityFirstStrategy
Bases: ConstraintHandlingStrategy
Source code in src/vamos/foundation/constraints/__init__.py
67 68 69 70 71 72 73 74 75 76 77 78 79 | |
PenaltyCVStrategy
Bases: ConstraintHandlingStrategy
Source code in src/vamos/foundation/constraints/__init__.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
CVAsObjectiveStrategy
Bases: ConstraintHandlingStrategy
Source code in src/vamos/foundation/constraints/__init__.py
98 99 100 101 102 103 104 105 106 107 108 109 | |
EpsilonConstraintStrategy
Bases: ConstraintHandlingStrategy
Source code in src/vamos/foundation/constraints/__init__.py
112 113 114 115 116 117 118 119 120 121 122 123 124 | |
compute_constraint_info(G, eps=0.0)
Compute aggregate constraint violation and feasibility mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
G
|
ndarray | None
|
Constraint values where |
required |
eps
|
float
|
Feasibility tolerance. Constraints |
``0.0``
|
Source code in src/vamos/foundation/constraints/__init__.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
get_constraint_strategy(name, **kwargs)
Source code in src/vamos/foundation/constraints/__init__.py
127 128 129 130 131 132 133 134 135 136 137 | |
vamos.foundation.constraints.utils
Utility helpers for constraint handling.
compute_violation(G, *, n=None)
Sum of positive parts per-solution; assumes G shape (N, n_constraints), g<=0 satisfied.
When G is None (unconstrained), n must be provided so the output
length is explicit.
Source code in src/vamos/foundation/constraints/utils.py
10 11 12 13 14 15 16 17 18 19 20 21 | |
is_feasible(G, *, n=None, eps=0.0)
Boolean feasibility mask; assumes G shape (N, n_constraints).
When G is None (unconstrained), n must be provided so the output
length is explicit.
eps is a feasibility tolerance: constraints with g(x) <= eps are
treated as satisfied (default 0.0).
Source code in src/vamos/foundation/constraints/utils.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
Encoding
vamos.foundation.encoding
normalize_encoding(value, *, default='real')
Normalize user/problem encoding strings to canonical encoding identifiers.
Canonical encodings are: "real", "binary", "permutation", "integer", "mixed".
Source code in src/vamos/foundation/encoding.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
Problem Registry
vamos.foundation.problem.registry
Problem registry: specs, selection, and factories.
available_problem_names()
Return the sorted names of all registered benchmark problems.
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
Problem keys that can be passed to |
Source code in src/vamos/foundation/problem/registry/specs.py
54 55 56 57 58 59 60 61 62 63 | |
make_problem_selection(key, *, n_var=None, n_obj=None)
Look up a registered problem by key and resolve its dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Registered problem name (e.g. |
required |
n_var
|
int
|
Override the default number of decision variables. |
None
|
n_obj
|
int
|
Override the default number of objectives (only for problems that allow it). |
None
|
Returns:
| Type | Description |
|---|---|
ProblemSelection
|
A frozen selection with the resolved |
Raises:
| Type | Description |
|---|---|
KeyError
|
If key does not match any registered problem. The error message includes the full list of valid names and close-match suggestions. |
Source code in src/vamos/foundation/problem/registry/selection.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
Tuning (experimental)
Parameters and Tuners for Hyperparameter Optimization.
vamos.engine.tuning.racing.core
RacingTuner
Racing tuner for algorithm configuration.
Source code in src/vamos/engine/tuning/racing/core.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
_check_convergence()
Check if best score has stagnated for convergence_window stages.
Source code in src/vamos/engine/tuning/racing/core.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
_get_current_best_score(configs)
Get the current best aggregated score among alive configs.
Source code in src/vamos/engine/tuning/racing/core.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
vamos.engine.tuning.racing.param_space
Hyperparameter space definitions for VAMOS tuning.
All parameter types use name as the first argument: - Real(name, low, high, log=False, role="operator_rate") - Int(name, low, high, log=False, role="population") - Categorical(name, choices, role="operator") - Boolean(name, role="adaptive")
All types support: - sample(rng) - draw a random value - to_unit(value) - map to [0, 1] space for optimization - from_unit(value) - map from [0, 1] space back to parameter value
Parameter roles (used by structured tuning workflows): - "structural": algorithm paradigm choices (decomposition, reference points) - "operator": discrete operator family choices (crossover type, mutation type) - "operator_rate": continuous operator parameters (eta, probabilities, sigma) - "population": resource allocation (pop_size, offspring_ratio, archive_size) - "adaptive": meta-parameters (immigration, adaptive operator selection)
Boolean
dataclass
Boolean hyperparameter (True/False).
Source code in src/vamos/engine/tuning/racing/param_space.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
Categorical
dataclass
Categorical hyperparameter with discrete choices.
Source code in src/vamos/engine/tuning/racing/param_space.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
from_unit(value)
Map from [0, 1] space to a choice.
Source code in src/vamos/engine/tuning/racing/param_space.py
131 132 133 134 135 | |
to_unit(value)
Map value to [0, 1] space based on choice index.
Source code in src/vamos/engine/tuning/racing/param_space.py
126 127 128 129 | |
Condition
dataclass
Simple condition: a parameter is considered active only when
expr evaluates to True given the current config.
Expressions are parsed safely (no function calls/attribute access).
Source code in src/vamos/engine/tuning/racing/param_space.py
155 156 157 158 159 160 161 162 163 164 165 | |
ConditionalBlock
dataclass
A block of parameters that are active only when a parent parameter has a specific value.
Source code in src/vamos/engine/tuning/racing/param_space.py
168 169 170 171 172 173 174 175 176 177 | |
Int
dataclass
Integer hyperparameter in [low, high] (inclusive).
Source code in src/vamos/engine/tuning/racing/param_space.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
from_unit(value)
Map from [0, 1] space to parameter value.
Source code in src/vamos/engine/tuning/racing/param_space.py
104 105 106 107 108 109 110 111 112 | |
to_unit(value)
Map value to [0, 1] space.
Source code in src/vamos/engine/tuning/racing/param_space.py
96 97 98 99 100 101 102 | |
ParamSpace
dataclass
Defines a hyperparameter space with named parameters.
Example: space = ParamSpace(params={ "lr": Real("lr", 0.001, 0.1, log=True), "epochs": Int("epochs", 10, 100), })
Source code in src/vamos/engine/tuning/racing/param_space.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
is_active(param_name, config)
Check if param is active given config and conditions.
Source code in src/vamos/engine/tuning/racing/param_space.py
208 209 210 211 212 213 | |
sample(rng=None)
Sample a configuration from the space.
Source code in src/vamos/engine/tuning/racing/param_space.py
202 203 204 205 206 | |
validate(config)
Validate that all active params are present and within bounds.
Source code in src/vamos/engine/tuning/racing/param_space.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
Real
dataclass
Real-valued hyperparameter in [low, high].
Source code in src/vamos/engine/tuning/racing/param_space.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
from_unit(value)
Map from [0, 1] space to parameter value.
Source code in src/vamos/engine/tuning/racing/param_space.py
65 66 67 68 69 70 71 | |
to_unit(value)
Map value to [0, 1] space.
Source code in src/vamos/engine/tuning/racing/param_space.py
57 58 59 60 61 62 63 | |
_MissingKeyError
Bases: Exception
Raised when a condition references a cfg key that is absent (inactive parent).
Source code in src/vamos/engine/tuning/racing/param_space.py
255 256 | |
_safe_eval_condition(expr, cfg)
Evaluate a condition expression against cfg using a restricted AST (no calls/attrs).
If the expression references a cfg key that is missing (because its parent
parameter is inactive), the condition evaluates to False.
Source code in src/vamos/engine/tuning/racing/param_space.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
Diagnostics
vamos.experiment.diagnostics.self_check
Lightweight self-check to verify a VAMOS installation.
Runs tiny NSGA-II jobs on ZDT1 across available backends and reports results. Intended for quick sanity checks; not a benchmark.
run_self_check(verbose=False)
Run a minimal set of smoke checks for each compute backend.
Always exercises NumPy; Numba and MooCore are optional and reported
as "skipped" when the dependency is missing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
list[CheckResult]
|
One entry per backend / encoding variant with |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the mandatory NumPy backend check fails. |
Source code in src/vamos/experiment/diagnostics/self_check.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |