FLAML
FLAML copied to clipboard
The definition of config_constraints and metric_constraints are not clear in Docs
There are two constraints can be used in tuning procedure,config_constraints
and metric_constraints
. What is the definition of config_constraints
? When we should use config_constraints
? What difference between config_constraints
and metric_constraints
? To my understanding, config_constraint
is used to restrict the specific attribute of a trial's config (e.g., area). The attribute of the config is constant during the trial training. On the other hand, metric_constraints
is used to constrain the performance of a trial (e.g., precision). The metric values fluctuate as the training. They are not constant. After I check the Doc, it seems not to explain their difference explicitly. Please enhance the documents. Thank you.
Thank you @YIWEI-CHEN for raising this issue. They are indeed not clearly explained in the current documentation.
Definitions:
-
config_constraints
is aList[Tuple[Callable[[dict], float], str, float]]
, meaning that the constraints are functions that needs to be provided by the user, e.g., thearea
function. -
While the
metric_constraints
is aList[Tuple[str, str, float]]
. The actual calculation of the constraints should be embedded in themetric
function and be reported accordingly. The user needs to specify the constraints name (in string format) inmetric_constraints
.
The differences and when should you use which:
- The key difference is that the calculation of constraints in
config_constraints
does not rely on the evaluation procedure in themetric
function. For example, when a constraint only depends on the config itself. - Another difference is that constraints in
config_constraints
will be checked before evaluation, so if a config does not satisfyconfig_constraints
it will not be evaluated.
Let me know if they are still unclear to you. And can you please also help improve the documentation accordingly? Thank you!