kubeflow / metadata

Repository for assets related to Metadata.
Apache License 2.0
121 stars 69 forks source link

Show Model hyperparameters in artifact/lineage UI #237

Closed ca-scribner closed 2 years ago

ca-scribner commented 3 years ago

/kind feature

Describe the solution you'd like Hyperparameters are stored in the Model metadata but not shown on the artifact page. When browsing models it would be useful to see the hyperparameters.

Anything else you would like to add: Hyperparameters are stored in the __ALL_META__ property of the Model artifact in mlmd, along with all other data. This JSON is omitted when showing the UI which means hyperparameters don't make it into the artifact page at all.

As a workaround I've subclassed the metadata.Model and added hyperparameters to the serialization as a custom_parameter:

class ModelWithHyperparameters(metadata.Model):
    def serialization(self):
        model_artifact = super().serialization()
        model_artifact.custom_properties["hyperparameters"].string_value = \
            json.dumps(self.hyperparameters)
        return model_artifact

but it feels like something that would fit nicely in the schema. I tried adding it to the Artifact properties but there is a schema enforced somewhere for that object and I wasn't sure where.

Is this an intentional omission or just a "haven't gotten to it yet"? If this was not an intentional omission, I'm happy to contribute a solution (either as a custom_properties entry or somewhere else if there's a better fit). Another alternative is to update the UI to pull select properties out of the __ALL_META__ JSON, but I can't really help there.

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the labels:

Label Probability
area/front-end 0.53

Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! Links: app homepage, dashboard and code for this bot.