Open m-mohr opened 1 year ago
Variants discussed in the ML meeting:
datacube = load_collection("s2", temporal_extent = ..., spatial_extent = ..., bands = ...)
model = load_ml_model("my-model-id")
# variant 1
function fn(data) {
return predict_ml_model(data, model)
}
datacube2 = reduce_dimension(datacube, dimension = "bands", reducer = fn)
function fn2(data) {
return predict_ml_model_probabilities(data, model)
}
datacube3 = apply_dimension(datacube, dimension = "bands", target_dimension = "probabilities", process = fn2)
# variant 2
datacube2 = predict_ml_model(datacube, dimension = "bands", model = model)
datacube3 = predict_ml_model_probabilities(datacube, dimension = "bands", model = model)
Some things from the ML meeting:
Regularization may consist of (and is mapped to openEO processes):
-> combine these to a new openEO process with some arguments that are commonly used with reasonable defaults
datacube = load_collection("s2", temporal_extent = ..., spatial_extent = ..., bands = ...)
model = load_ml_model("my-model-id")
# variant 1 (does NOT work with the current definition in this PR)
function fn(data) {
let values = ml_predict(data, model)
return array_element(values, 0)
}
datacube2 = reduce_dimension(datacube, dimension = "bands", reducer = fn)
function fn2(data) {
return ml_predict(data, model)
}
datacube3 = apply_dimension(datacube, dimension = "bands", target_dimension = "predictions", process = fn2)
# variant 2 (works with the current definition in this PR)
datacube2 = ml_predict(datacube, model)
datacube2 = drop_dimension(datacube, "predictions")
datacube3 = ml_predict(datacube, model)
@m-mohr , is there a reason why the keyword fit is used in the naming convention instead of train? I will work on data cube regularization and do a different PR.
Just to align with fit_cuve, I guess. Train is also fine...
Just to align with fit_cuve, I guess. Train is also fine...
Cool
@m-mohr is renaming these two to follow with a prefix of "ml" a possible alternative? load_ml_model() > ml_load_model() save_ml_model() > ml_save_model()
Why? The current proposal follows the load_* and save_result schema.
Why? The current proposal follows the load_* and save_result schema.
Cool makes sense to follow the previous schema. My initial thoughts came from the perception that it would be good for a general user if most of the ml operations start with that prefix i.e. "ml_".
The STAC ML Model extension may get deprecated in favor of https://github.com/crim-ca/dlm-extension @PondiB I think it would be great to get in touch with the folks so that we can influence that it also works for openEO.
The STAC ML Model extension may get deprecated in favor of https://github.com/crim-ca/dlm-extension @PondiB I think it would be great to get in touch with the folks so that we can influence that it also works for openEO.
Sure thanks, I just saw the notification about it, I will follow up with them.
Potentially interesting for "bring your own model": https://onnx.ai/