Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
add mlm:hyperparameters defintion (fixes #14)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Apr 4, 2024
1 parent be58e86 commit 8b46388
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The fields in the table below can be used in these parts of STAC documents:
| mlm:accelerator_count | integer | A minimum amount of `accelerator` instances required to run the model. |
| mlm:input | \[[Model Input Object](#model-input-object)] | **REQUIRED** Describes the transformation between the EO data and the model input. |
| mlm:output | \[[Model Output Object](#model-output-object)] | **REQUIRED** Describes each model output and how to interpret it. |
| mlm:hyperparameters | [Model Hyperparameters Object](#model-hyperparameters-object) | Additional hyperparameters relevant for the model. |

To decide whether above fields should be applied under Item `properties` or under respective Assets, the context of
each field must be considered. For example, the `mlm:name` should always be provided in the Item `properties`, since
Expand Down Expand Up @@ -391,6 +392,27 @@ as for `regression`, `image-captioning`, `super-resolution` and some `generative
See the documentation for the
[Class Object](https://github.com/stac-extensions/classification?tab=readme-ov-file#class-object).

### Model Hyperparameters Object

The hyperparameters are an open JSON object definition that can be used to provide relevant configurations for the
model. Those can combine training details, inference runtime parameters, or both. For example, training hyperparameters
could indicate the number of epochs that were used, the optimizer employed, the number of estimators contained in an
ensemble of models, or the random state value. For inference, parameters such as the model temperature, a confidence
cut-off threshold, or a non-maximum suppression threshold to limit proposal could be specified. The specific parameter
names, and how they should be employed by the model, are specific to each implementation.

Following is an example of what the hyperparameters definition could look like:

```json
{
"mlm:hyperparameters": {
"nms_max_detections": 500,
"nms_threshold": 0.25,
"iou_threshold": 0.5,
"random_state": 12345
}
}
```

## Assets Objects

Expand Down
11 changes: 11 additions & 0 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@
},
"mlm:output": {
"$ref": "#/$defs/mlm:output"
},
"mlm:hyperparameters": {
"$ref": "#/$defs/mlm:hyperparameters"
}
},
"$comment": "Allow properties not defined by MLM prefix to allow combination with other extensions.",
Expand Down Expand Up @@ -435,6 +438,14 @@
}
}
},
"mlm:hyperparameters": {
"type": "object",
"minProperties": 1,
"patternProperties": {
"^[0-9a-zA-Z_.-]+$": true
},
"additionalProperties": false
},
"InputStructure": {
"title": "Input Structure Object",
"type": "object",
Expand Down

0 comments on commit 8b46388

Please sign in to comment.