Skip to content

Commit

Permalink
Merge pull request #59 from stac-extensions/fix-mlm-artefact-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault authored Nov 22, 2024
2 parents 08ce10c + c6403f4 commit 42052ec
Show file tree
Hide file tree
Showing 14 changed files with 380 additions and 110 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
for the entire input (but still possible).

### Changed
- Explicitly disallow `mlm:name`, `mlm:input`, `mlm:output` and `mlm:hyperparameters` at the Asset level.
These fields describe the model as a whole and should therefore be defined in Item properties.
- Moved `norm_type` to `value_scaling` object to better reflect the expected operation, which could be another
operation than what is typically known as "normalization" or "standardization" techniques in machine learning.
- Moved `statistics` to `value_scaling` object to better reflect their mutual `type` and additional
Expand All @@ -36,6 +38,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Otherwise, the amount of `value_scaling` objects should match the number of bands or channels involved in the input.

### Fixed
- Fix missing `mlm:artifact_type` property check for a Model Asset definition
(fixes <https://github.com/stac-extensions/mlm/issues/42>).
The `mlm:artifact_type` is now mutually and exclusively required by the corresponding Asset with `mlm:model` role.
- Fix check of disallowed unknown/undefined `mlm:`-prefixed fields
(fixes [#41](https://github.com/stac-extensions/mlm/issues/41)).

Expand Down
86 changes: 50 additions & 36 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/item_bands_expression.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"mlm:model",
"mlm:weights"
],
"mlm:artifact_type": "torch.save",
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
"eo:bands": [
{
Expand Down
3 changes: 2 additions & 1 deletion examples/item_basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@
"type": "text/html",
"roles": [
"mlm:model"
]
],
"mlm:artifact_type": "torch.save"
}
},
"links": [
Expand Down
2 changes: 1 addition & 1 deletion examples/item_eo_and_raster_bands.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@
"mlm:model",
"mlm:weights"
],
"mlm:artifact_type": "torch.save",
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
"eo:bands": [
{
Expand Down Expand Up @@ -557,7 +558,6 @@
"description": "Source code to run the model.",
"type": "text/x-python",
"roles": [
"mlm:model",
"code",
"metadata"
]
Expand Down
1 change: 1 addition & 0 deletions examples/item_eo_bands.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
"mlm:model",
"mlm:weights"
],
"mlm:artifact_type": "torch.save",
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
"eo:bands": [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/item_eo_bands_summarized.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@
"mlm:model",
"mlm:weights"
],
"mlm:artifact_type": "torch.save",
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
"eo:bands": [
{
Expand Down Expand Up @@ -426,7 +427,6 @@
"description": "Source code to run the model.",
"type": "text/x-python",
"roles": [
"mlm:model",
"code",
"metadata"
]
Expand Down
1 change: 1 addition & 0 deletions examples/item_multi_io.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
"mlm:model",
"mlm:weights"
],
"mlm:artifact_type": "torch.save",
"raster:bands": [
{
"name": "B02 - blue",
Expand Down
1 change: 1 addition & 0 deletions examples/item_raster_bands.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"mlm:model",
"mlm:weights"
],
"mlm:artifact_type": "torch.save",
"raster:bands": [
{
"name": "B01",
Expand Down
Loading

0 comments on commit 42052ec

Please sign in to comment.