diff --git a/_sources/features/custom_scripts.md.txt b/_sources/features/custom_scripts.md.txt index f4a8b6669..14ab4ba22 100644 --- a/_sources/features/custom_scripts.md.txt +++ b/_sources/features/custom_scripts.md.txt @@ -51,8 +51,8 @@ Use `my_script.py` with Olive workflow configuration json file(sub_types name sh "type": "accuracy", "sub_types": [ {"name": "accuracy_score", "priority": 1, "goal": {"type": "max-degradation", "value": 0.01}}, - {"name": "f1_score", "metric_config": {"multiclass": false}}, - {"name": "auroc", "metric_config": {"num_classes": 2}} + {"name": "f1_score"}, + {"name": "auroc"} ], "user_config":{ "post_processing_func": "post_process", @@ -103,8 +103,8 @@ Use `script_dir` and `my_script.py` with Olive workflow configuration json file: "type": "accuracy", "sub_types": [ {"name": "accuracy_score", "priority": 1, "goal": {"type": "max-degradation", "value": 0.01}}, - {"name": "f1_score", "metric_config": {"multiclass": false}}, - {"name": "auroc", "metric_config": {"num_classes": 2}} + {"name": "f1_score"}, + {"name": "auroc"} ] "user_config":{ "post_processing_func": "post_process", diff --git a/_sources/overview/options.md.txt b/_sources/overview/options.md.txt index ae6b31e50..9870fa72e 100644 --- a/_sources/overview/options.md.txt +++ b/_sources/overview/options.md.txt @@ -233,7 +233,7 @@ information of the evaluator contains following items: - `type: [str]` The type of the metric. The supported types are `accuracy`, `latency`, `throughput` and `custom`. - `backend: [str]` The type of metrics' backend. Olive implement `torch_metrics` and `huggingface_metrics` backends. The default value is `torch_metrics`. - - `torch_metrics` backend uses `torchmetrics` library to compute metrics. It supports `accuracy_score`, `f1_score`, `precision`, `recall` and `auc` metrics. + - `torch_metrics` backend uses `torchmetrics`(>=0.1.0) library to compute metrics. It supports `accuracy_score`, `f1_score`, `precision`, `recall` and `auroc` metrics which are used for `binary` task (equal to `metric_config:{"task": "binary"}`) by default. You need alter the `task` if needed. Please refer to [torchmetrics](https://lightning.ai/docs/torchmetrics/stable/) for more details. - `huggingface_metrics` backend uses huggingface `evaluate` library to compute metrics. The supported metrics can be found at [huggingface metrics](https://huggingface.co/metrics). - `subtypes: [List[Dict]]` The subtypes of the metric. Cannot be null or empty. Each subtype is a dictionary that contains following items: @@ -311,8 +311,8 @@ information of the evaluator contains following items: "type": "accuracy", "sub_types": [ {"name": "accuracy_score", "priority": 1, "goal": {"type": "max-degradation", "value": 0.01}}, - {"name": "f1_score", "metric_config": {"multiclass": false}}, - {"name": "auroc", "metric_config": {"num_classes": 2}} + {"name": "f1_score"}, + {"name": "auroc"} ], "user_config":{ "post_processing_func": "post_process", diff --git a/_sources/tutorials/configure_metrics.rst.txt b/_sources/tutorials/configure_metrics.rst.txt index ff45262e1..882272cc7 100644 --- a/_sources/tutorials/configure_metrics.rst.txt +++ b/_sources/tutorials/configure_metrics.rst.txt @@ -19,8 +19,8 @@ Accuracy Metric "type": "accuracy", "sub_types": [ {"name": "accuracy_score", "priority": 1, "goal": {"type": "max-degradation", "value": 0.01}}, - {"name": "f1_score", "metric_config": {"multiclass": false}}, - {"name": "auroc", "metric_config": {"num_classes": 2}} + {"name": "f1_score"}, + {"name": "auroc"} ], "user_config": { "post_processing_func": "post_process", @@ -227,8 +227,8 @@ If you have multiple metrics to evaluate, you can configure them in the followin "type": "accuracy", "sub_types": [ {"name": "accuracy_score", "priority": 1, "goal": {"type": "max-degradation", "value": 0.01}}, - {"name": "f1_score", "metric_config": {"multiclass": false}}, - {"name": "auroc", "metric_config": {"num_classes": 2}} + {"name": "f1_score"}, + {"name": "auroc"} ] }, { diff --git a/features/custom_scripts.html b/features/custom_scripts.html index 86510ad66..7a7a24374 100644 --- a/features/custom_scripts.html +++ b/features/custom_scripts.html @@ -184,8 +184,8 @@
type: [str]
The type of the metric. The supported types are accuracy
, latency
, throughput
and custom
.
backend: [str]
The type of metrics’ backend. Olive implement torch_metrics
and huggingface_metrics
backends. The default value is torch_metrics
.
torch_metrics
backend uses torchmetrics
library to compute metrics. It supports accuracy_score
, f1_score
, precision
, recall
and auc
metrics.
torch_metrics
backend uses torchmetrics
(>=0.1.0) library to compute metrics. It supports accuracy_score
, f1_score
, precision
, recall
and auroc
metrics which are used for binary
task (equal to metric_config:{"task": "binary"}
) by default. You need alter the task
if needed. Please refer to torchmetrics for more details.
huggingface_metrics
backend uses huggingface evaluate
library to compute metrics. The supported metrics can be found at huggingface metrics.