You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: update README and README.zh.md for clarity and consistency
- Revised sections in both English and Chinese README files to enhance clarity, including the quick start guide and parameter management features.
- Corrected minor typographical errors, such as "tunning" to "tuning."
- Improved formatting and organization of content for better readability.
- Added a new section on behavior guarantees to outline key features and error handling.
# Running from source? Use module mode or install editable
33
-
# python -m hyperparameter.examples.quickstart
34
-
# or: pip install -e .
35
-
```
36
-
37
-
## Why Hyperparameter?
38
-
39
-
### 🚀 Unmatched Performance (vs Hydra)
40
-
41
-
Hyperparameter is built on a high-performance Rust backend, making it significantly faster than pure Python alternatives like Hydra, especially in inner-loop parameter access.
# Running from source? Use module mode or install editable
33
+
# python -m hyperparameter.examples.quickstart
34
+
# or: pip install -e .
35
+
```
36
+
37
+
## Why Hyperparameter?
38
+
39
+
### 🚀 Unmatched Performance (vs Hydra)
40
+
41
+
Hyperparameter is built on a high-performance Rust backend, making it significantly faster than pure Python alternatives like Hydra, especially in inner-loop parameter access.
> Benchmark scenario: Accessing a nested parameter `model.layers.0.size` 1,000,000 times in a loop.
50
+
> See `benchmark/` folder for reproduction scripts.
51
+
52
+
### ✨ Zero-Dependency Schema Validation
53
+
54
+
Hyperparameter supports structural validation using standard Python type hints without introducing heavy dependencies (like Pydantic or OmegaConf).
55
+
56
+
```python
57
+
from dataclasses import dataclass
58
+
import hyperparameter as hp
59
+
60
+
@dataclass
61
+
classAppConfig:
62
+
host: str
63
+
port: int
64
+
debug: bool=False
65
+
66
+
# Validates types and converts automatically: "8080" -> 8080 (int)
67
+
cfg = hp.config("config.toml", schema=AppConfig)
68
+
```
69
+
70
+
## Key Features
71
71
72
72
### For Python Users
73
73
74
74
-**Pythonic Syntax:** Define hyperparameters using keyword argument syntax;
75
-
76
-
- **Intuitive Scoping:** Control parameter scope through `with` statement;
77
-
78
-
- **Configuration File:** Easy to load parameters from config files (JSON/TOML/YAML) with composition and interpolation support;
79
-
80
-
- **Zero-Overhead Validation:** Optional schema validation using standard Python type hints;
75
+
-**Intuitive Scoping:** Control parameter scope through `with` statement;
76
+
-**Configuration File:** Easy to load parameters from config files (JSON/TOML/YAML) with composition and interpolation support;
77
+
-**Zero-Overhead Validation:** Optional schema validation using standard Python type hints;
81
78
82
-
### For Rust and C++ Users
79
+
### For Rust and C++ Users
83
80
84
81
-**High-Performance Backend:** Hyperparameter is implemented in Rust, providing a robust and high-performance backend for hyperparameter management. Access hyperparameters in Rust and C++ with minimal overhead, making it ideal for ML and system developers who prioritize performance.
85
82
@@ -288,7 +285,7 @@ fn foo() {
288
285
289
286
## More Examples
290
287
291
-
### [parameter tunning for researchers](examples/sparse_lr/README.md)
288
+
### [parameter tuning for researchers](examples/sparse_lr/README.md)
292
289
293
290
This example demonstrates how to use hyperparameter in research projects, and make experiments reproducible.
0 commit comments