tessl install tessl/pypi-yacs@0.1.0A lightweight library for defining and managing system configurations for scientific experimentation.
Agent Success
Agent success rate when using this tile
97%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.05x
Baseline
Agent success rate without this tile
92%
Create a configuration system with custom validation rules for a machine learning training pipeline. The system should validate configuration values automatically and provide helpful error messages when invalid values are detected.
Implement a custom configuration class that extends YACS's configuration functionality to add validation logic. The validator should enforce the following rules:
Your implementation should:
@generates
class ValidatedConfig:
"""
A configuration class that extends YACS CfgNode with custom validation.
Validates:
- LEARNING_RATE: Must be in range (0.0, 1.0]
- BATCH_SIZE: Must be a positive integer
- OPTIMIZER: Must be one of ["adam", "sgd", "rmsprop"]
"""
pass
def get_default_config():
"""
Returns a new ValidatedConfig instance with default training parameters.
Default values:
- LEARNING_RATE: 0.001
- BATCH_SIZE: 32
- OPTIMIZER: "adam"
Returns:
ValidatedConfig: A configuration instance with defaults
"""
passProvides the base configuration system with CfgNode class.
@satisfied-by