Skip to content

Commit 42052ec

Browse files
authored
Merge pull request #59 from stac-extensions/fix-mlm-artefact-v2
2 parents 08ce10c + c6403f4 commit 42052ec

14 files changed

+380
-110
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
for the entire input (but still possible).
1919

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

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

README.md

Lines changed: 50 additions & 36 deletions
Large diffs are not rendered by default.

examples/item_bands_expression.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"mlm:model",
151151
"mlm:weights"
152152
],
153+
"mlm:artifact_type": "torch.save",
153154
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
154155
"eo:bands": [
155156
{

examples/item_basic.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
"type": "text/html",
121121
"roles": [
122122
"mlm:model"
123-
]
123+
],
124+
"mlm:artifact_type": "torch.save"
124125
}
125126
},
126127
"links": [

examples/item_eo_and_raster_bands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@
508508
"mlm:model",
509509
"mlm:weights"
510510
],
511+
"mlm:artifact_type": "torch.save",
511512
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
512513
"eo:bands": [
513514
{
@@ -557,7 +558,6 @@
557558
"description": "Source code to run the model.",
558559
"type": "text/x-python",
559560
"roles": [
560-
"mlm:model",
561561
"code",
562562
"metadata"
563563
]

examples/item_eo_bands.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@
285285
"mlm:model",
286286
"mlm:weights"
287287
],
288+
"mlm:artifact_type": "torch.save",
288289
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
289290
"eo:bands": [
290291
{

examples/item_eo_bands_summarized.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
"mlm:model",
378378
"mlm:weights"
379379
],
380+
"mlm:artifact_type": "torch.save",
380381
"$comment": "Following 'eo:bands' is required to fulfil schema validation of 'eo' extension.",
381382
"eo:bands": [
382383
{
@@ -426,7 +427,6 @@
426427
"description": "Source code to run the model.",
427428
"type": "text/x-python",
428429
"roles": [
429-
"mlm:model",
430430
"code",
431431
"metadata"
432432
]

examples/item_multi_io.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
"mlm:model",
228228
"mlm:weights"
229229
],
230+
"mlm:artifact_type": "torch.save",
230231
"raster:bands": [
231232
{
232233
"name": "B02 - blue",

examples/item_raster_bands.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
"mlm:model",
217217
"mlm:weights"
218218
],
219+
"mlm:artifact_type": "torch.save",
219220
"raster:bands": [
220221
{
221222
"name": "B01",

0 commit comments

Comments
 (0)