Hyperparameter
Hyperparameter, Make configurable AI applications. Build for Python/Rust hackers.
Hyperparameter is a Python/Rust library for managing hyperparameters that control the learning process of an ML model or the behaviors of an underlying machine learning system.
Quick Start
Using Hyperparameter
in Python
First, with decorator auto_param
, we can define hyperparameters by adding keyword arguments to a function:
return f
Then, we can control hyperparameters with param_scope
:
# x=1, y='a'
# x=2, y='a'
Using Hyperparameter
in Rust
Features
-
Default value for all parameters:
# python = |
// rust get x = foo.x or "default value";
-
Scoped parameter values:
# python # 1st scope start =1 # 2nd scope start =2 # 2nd scope end # 1st scope end
// rust with_params! // 1st scope end
-
Thread Isolation and Thread Safety
# python # print foo.x =2 # modify foo.x in current thread # foo.x=2 # foo.x=1, the above modification does not affect new thread
// rust
Build CMD Line Application with Hyperparameter
We can define parameters with a command line argument (for example, -D, --define
), and call the application with following command:
A quick implementation of -D,--define
:
# example.py
=
=
//rust
Examples
parameter tunning for researchers
This example demonstrates how to use hyperparameter in research projects, and make experiments reproducible.
experiment tracing for data scientists
This example showcases experiment management with hyperparameter and result tracing with mlflow.tracing.