manifest
orchard.core.config.manifest
¶
Vision Pipeline Configuration Manifest.
Defines the hierarchical Config schema that aggregates specialized
sub-configs (Hardware, Dataset, Architecture, Training, Evaluation,
Augmentation, Optuna, Export) into a single immutable manifest.
Layout:
Config— main Pydantic model, ordered as: Fields & model validator, Properties (run_slug,num_workers), Serialization (dump_portable,dump_serialized),from_recipe— primary factory (orchardCLI)_CrossDomainValidator— cross-domain validation logic (AMP vs Device, LR bounds, Mixup scheduling, resolution/model pairing)_deep_set— dot-notation dict helper for CLI overrides
Config
¶
Bases: BaseModel
Main experiment manifest aggregating specialized sub-configurations.
Serves as the Single Source of Truth (SSOT) for all experiment parameters. Validates cross-domain logic (AMP/device compatibility, resolution/model pairing) and provides factory methods for YAML and CLI instantiation.
Attributes:
| Name | Type | Description |
|---|---|---|
task_type |
TaskType
|
ML task type (currently |
hardware |
HardwareConfig
|
Device selection, threading, reproducibility settings |
telemetry |
TelemetryConfig
|
Logging, paths, experiment naming |
training |
TrainingConfig
|
Optimizer, scheduler, epochs, regularization |
augmentation |
AugmentationConfig
|
Data augmentation and TTA parameters |
dataset |
DatasetConfig
|
Dataset selection, resolution, normalization |
evaluation |
EvaluationConfig
|
Metrics, visualization, reporting settings |
architecture |
ArchitectureConfig
|
Architecture selection, pretrained weights |
optuna |
OptunaConfig | None
|
Hyperparameter optimization configuration (optional) |
export |
ExportConfig | None
|
Model export configuration for ONNX (optional) |
tracking |
TrackingConfig | None
|
Experiment tracking configuration for MLflow (optional) |
Example
from orchard.core import Config cfg = Config.from_recipe(Path("recipes/config_mini_cnn.yaml")) cfg.architecture.name 'mini_cnn'
run_slug
property
¶
Generate unique experiment folder identifier.
Combines dataset name and model name for human-readable
run identification in output directories. Slashes in
architecture names (e.g. timm/convnext_base) are
replaced with underscores to keep paths flat.
Returns:
| Type | Description |
|---|---|
str
|
String in format '{dataset_name}_{model_name}'. |
num_workers
property
¶
Get effective DataLoader workers from hardware policy.
Delegates to hardware config which respects reproducibility constraints (returns 0 if reproducible mode enabled).
Returns:
| Type | Description |
|---|---|
int
|
Number of DataLoader worker processes. |
validate_logic()
¶
Cross-domain validation enforcing consistency across sub-configs.
Invokes _CrossDomainValidator to check:
- Model/resolution compatibility (ResNet-18 → 28x28)
- Training epochs bounds (mixup_epochs ≤ epochs)
- Hardware/feature alignment (AMP requires GPU)
- Pretrained/channel consistency (pretrained → RGB)
- Optimizer bounds (min_lr < learning_rate)
Returns:
| Type | Description |
|---|---|
'Config'
|
Validated Config instance with auto-corrections applied |
Raises:
| Type | Description |
|---|---|
OrchardConfigError
|
On irrecoverable validation failures |
Source code in orchard/core/config/manifest.py
dump_portable()
¶
Serialize config with environment-agnostic paths.
Converts absolute filesystem paths to project-relative paths (e.g., '/home/user/project/dataset' -> './dataset') to prevent host-specific path leakage in exported configurations.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with all paths converted to portable relative strings. |
Source code in orchard/core/config/manifest.py
dump_serialized()
¶
Convert config to JSON-compatible dict for YAML serialization.
Uses Pydantic's json mode to ensure all values are serializable (Path objects become strings, enums become values, etc.).
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with all values JSON-serializable for YAML export. |
Source code in orchard/core/config/manifest.py
from_recipe(recipe_path, overrides=None)
classmethod
¶
Factory from YAML recipe with optional dot-notation overrides.
Loads the recipe, applies overrides to the raw dict before
Pydantic instantiation, resolves dataset metadata, and returns
a validated Config. This is the preferred entry point for the
orchard CLI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe_path
|
Path
|
Path to YAML recipe file |
required |
overrides
|
dict[str, Any] | None
|
Flat dict of dot-notation keys to values
(e.g. |
None
|
Returns:
| Type | Description |
|---|---|
'Config'
|
Validated Config instance |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If recipe_path does not exist |
ValueError
|
If recipe is missing |
KeyError
|
If dataset not found in registry |
Example
cfg = Config.from_recipe(Path("recipes/config_mini_cnn.yaml")) cfg = Config.from_recipe( ... Path("recipes/config_mini_cnn.yaml"), ... overrides={"training.epochs": 20, "training.seed": 123}, ... )