Skip to content

Commit

Permalink
Merge pull request #553 from mlte-team/mlte-514
Browse files Browse the repository at this point in the history
MLTE-514
  • Loading branch information
sei-secheverria authored Dec 18, 2024
2 parents 4064f72 + 8cb26f8 commit 96b5d5e
Show file tree
Hide file tree
Showing 74 changed files with 610 additions and 579 deletions.
20 changes: 10 additions & 10 deletions demo/scenarios/1_requirements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -527,24 +527,24 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In MLTE, we define requirements by constructing a specification (`Spec`). For each property, we define the validations to perform as well. Note that several new `Value` types (`MultipleAccuracy`, `RankSums`, `MultipleRanksums`) had to be created to define the validation methods that will validate each Condition."
"In MLTE, we define requirements by constructing a specification (`Spec`). For each QA category, we define the validations to perform as well. Note that several new `Value` types (`MultipleAccuracy`, `RankSums`, `MultipleRanksums`) had to be created to define the validation methods that will validate each Condition."
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from mlte.spec.spec import Spec\n",
"\n",
"# The Properties we want to validate, associated with our scenarios.\n",
"from mlte.property.costs.storage_cost import StorageCost\n",
"from mlte.property.fairness.fairness import Fairness\n",
"from mlte.property.robustness.robustness import Robustness\n",
"from mlte.property.interpretability.interpretability import Interpretability\n",
"from mlte.property.costs.predicting_memory_cost import PredictingMemoryCost\n",
"from mlte.property.costs.predicting_compute_cost import PredictingComputeCost\n",
"from mlte.qa_category.costs.storage_cost import StorageCost\n",
"from mlte.qa_category.fairness.fairness import Fairness\n",
"from mlte.qa_category.robustness.robustness import Robustness\n",
"from mlte.qa_category.interpretability.interpretability import Interpretability\n",
"from mlte.qa_category.costs.predicting_memory_cost import PredictingMemoryCost\n",
"from mlte.qa_category.costs.predicting_compute_cost import PredictingComputeCost\n",
"\n",
"# The Value types we will use to validate each condition.\n",
"from mlte.measurement.storage import LocalObjectSize\n",
Expand All @@ -562,9 +562,9 @@
"from demo.scenarios.values.string import String\n",
"\n",
"\n",
"# The full spec. Note that the Robustness Property contains conditions for both Robustness scenarios.\n",
"# The full spec. Note that the Robustness QACategory contains conditions for both Robustness scenarios.\n",
"spec = Spec(\n",
" properties={\n",
" qa_categories={\n",
" Fairness(\n",
" \"Important check if model performs well accross different populations\"\n",
" ): {\n",
Expand Down
2 changes: 1 addition & 1 deletion demo/scenarios/2_evidence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"## 2. Collect Evidence\n",
"\n",
"In the second phase of SDMT, we collect _evidence_ to attest to the fact that the model realized the properties specified in the previous phase.\n",
"In the second phase of SDMT, we collect _evidence_ to attest to the fact that the model realized the QA categories specified in the previous phase.\n",
"\n",
"We define and instantiate `Measurement`s to generate this evidence. Each individual piece of evidence is a `Value`. Once `Value`s are produced, we can persist them to an _artifact store_ to maintain our evidence across sessions. "
]
Expand Down
8 changes: 4 additions & 4 deletions demo/scenarios/properties/accuracy.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from mlte.property.base import Property
from mlte.qa_category.base import QACategory


class Accuracy(Property):
class Accuracy(QACategory):
"""
The Accuracy property reflects the overall functional accuracy of a model.
The Accuracy QA category reflects the overall functional accuracy of a model.
"""

def __init__(self, rationale: str):
"""Initialize a Accuracy instance."""
super().__init__(
instance=self,
description="""
The Accuracy property assesses the total predictive performance requirements of a
The Accuracy QA category assesses the total predictive performance requirements of a
model and system. These requirements are typically given as a single real valued number.
""",
rationale=rationale,
Expand Down
10 changes: 5 additions & 5 deletions demo/scenarios/properties/interoperability.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from mlte.property.base import Property
from mlte.qa_category.base import QACategory


class Interoperability(Property):
class Interoperability(QACategory):
"""
The Interoperability property reflects contract requirements on model interfaces.
The Interoperability QA category reflects contract requirements on model interfaces.
"""

def __init__(self, rationale: str):
"""Initialize a Interoperability instance."""
super().__init__(
instance=self,
description="""
The Interoperability property evaluates the requirements on the interfaces to a model and system.
These requirements may be expressed in a variety of ways,
The Interoperability QA category evaluates the requirements on the
interfaces to a model and system. These requirements may be expressed in a variety of ways,
including requriements on line formats in log files, timestamps, and log content.
""",
rationale=rationale,
Expand Down
8 changes: 4 additions & 4 deletions demo/scenarios/properties/monitorability.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from mlte.property.base import Property
from mlte.qa_category.base import QACategory


class Monitorability(Property):
class Monitorability(QACategory):
"""
The Monitorability property reflects monitoring requirements.
The Monitorability QA category reflects monitoring requirements.
"""

def __init__(self, rationale: str):
"""Initialize a Monitorability instance."""
super().__init__(
instance=self,
description="""
The Monitorability property assesses the monitoring requirements of a
The Monitorability QA category assesses the monitoring requirements of a
model and system. These requirements may be expressed in a variety of ways,
including requriements on line formats in log files, timestamps, and log content.
""",
Expand Down
12 changes: 6 additions & 6 deletions demo/scenarios/properties/resilience.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
from mlte.property.base import Property
from mlte.qa_category.base import QACategory


class Resilience(Property):
class Resilience(QACategory):
"""
The Resilience property reflects ...
The Resilience QA category reflects ...
"""

def __init__(self, rationale: str):
"""Initialize a Resilience instance."""
super().__init__(
instance=self,
description="""
The Resilience property assesses if a component is able to continue to carry out its mission in
the face of adversity (i.e., if it provides required capabilities despite excessive stresses
that can cause disruptions).
The Resilience QA category assesses if a component is able to continue
to carry out its mission in the face of adversity (i.e., if it provides required
capabilities despite excessive stresses that can cause disruptions).
""",
rationale=rationale,
)
2 changes: 1 addition & 1 deletion demo/simple/evidence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"## 2. Collect Evidence\n",
"\n",
"In the second phase of SDMT, we collect _evidence_ to attest to the fact that the model realized the properties specified in the previous phase.\n",
"In the second phase of SDMT, we collect _evidence_ to attest to the fact that the model realized the QA categories specified in the previous phase.\n",
"\n",
"We define and instantiate `Measurement`s to generate this evidence. Each individual piece of evidence is a `Value`. Once `Value`s are produced, we can persist them to an _artifact store_ to maintain our evidence across sessions. "
]
Expand Down
14 changes: 7 additions & 7 deletions demo/simple/requirements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@
"source": [
"#### Build a `Specification`\n",
"\n",
"In MLTE, we define requirements by constructing a specification (`Spec`). For each property, we define the validations to perform as well."
"In MLTE, we define requirements by constructing a specification (`Spec`). For each QA category, we define the validations to perform as well."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from mlte.spec.spec import Spec\n",
"\n",
"from mlte.property.costs.storage_cost import StorageCost\n",
"from mlte.property.costs.training_memory_cost import TrainingMemoryCost\n",
"from mlte.property.costs.training_compute_cost import TrainingComputeCost\n",
"from mlte.property.functionality.task_efficacy import TaskEfficacy\n",
"from mlte.qa_category.costs.storage_cost import StorageCost\n",
"from mlte.qa_category.costs.training_memory_cost import TrainingMemoryCost\n",
"from mlte.qa_category.costs.training_compute_cost import TrainingComputeCost\n",
"from mlte.qa_category.functionality.task_efficacy import TaskEfficacy\n",
"\n",
"\n",
"from mlte.measurement.storage import LocalObjectSize\n",
Expand All @@ -70,7 +70,7 @@
"from mlte.value.types.image import Image\n",
"\n",
"spec = Spec(\n",
" properties={\n",
" qa_categories={\n",
" TaskEfficacy(\n",
" \"Important to understand if the model is useful for this case\"\n",
" ): {\n",
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/using_mlte.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ A `Specification` (or `Spec`) represents the requirements the model must meet in

```python
from mlte.spec.spec import Spec
from mlte.property.costs.storage_cost import StorageCost
from mlte.property.fairness.fairness import Fairness
from mlte.qa_category.costs.storage_cost import StorageCost
from mlte.qa_category.fairness.fairness import Fairness

from mlte.measurement.storage import LocalObjectSize
from demo.scenarios.values.multiple_accuracy import MultipleAccuracy
Expand Down Expand Up @@ -198,10 +198,10 @@ A `Spec` represents the requirements and corresponding thresholds (or validators
from mlte.spec.spec import Spec

# The Properties we want to validate, associated with our scenarios.
from mlte.property.costs.storage_cost import StorageCost
from mlte.property.fairness.fairness import Fairness
from mlte.property.robustness.robustness import Robustness
from mlte.property.costs.predicting_memory_cost import PredictingMemoryCost
from mlte.qa_category.costs.storage_cost import StorageCost
from mlte.qa_category.fairness.fairness import Fairness
from mlte.qa_category.robustness.robustness import Robustness
from mlte.qa_category.costs.predicting_memory_cost import PredictingMemoryCost

# The Value types we will use to validate each condition.
from mlte.measurement.storage import LocalObjectSize
Expand Down
8 changes: 4 additions & 4 deletions mlte/catalog/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class CatalogEntry(Filtrable):
tags: List[str] = []
"""Tags for the problem for the entry."""

property_category: Optional[str] = None
"""The property category or QA for the entry."""
qa_category: Optional[str] = None
"""The QA category for the entry."""

property: Optional[str] = None
"""The property for the entry."""
quality_attribute: Optional[str] = None
"""The quality attribute for the entry."""

code_type: CatalogEntryType
"""The code type the entry."""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$defs": {
"ConditionModel": {
"description": "A description of a condition for a property.",
"description": "A description of a condition for a QACategory.",
"properties": {
"name": {
"title": "Name",
Expand Down Expand Up @@ -30,8 +30,8 @@
"title": "ConditionModel",
"type": "object"
},
"PropertyModel": {
"description": "A description of a property.",
"QACategoryModel": {
"description": "A description of a quality attribute category.",
"properties": {
"name": {
"title": "Name",
Expand Down Expand Up @@ -78,7 +78,7 @@
"name",
"module"
],
"title": "PropertyModel",
"title": "QACategoryModel",
"type": "object"
}
},
Expand All @@ -93,13 +93,13 @@
"title": "Artifact Type",
"type": "string"
},
"properties": {
"type": "array",
"qa_categories": {
"default": [],
"items": {
"$ref": "#/$defs/PropertyModel"
"$ref": "#/$defs/QACategoryModel"
},
"default": [],
"title": "Properties"
"title": "Qa Categories",
"type": "array"
}
},
"title": "SpecModel",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$defs": {
"ConditionModel": {
"description": "A description of a condition for a property.",
"description": "A description of a condition for a QACategory.",
"properties": {
"name": {
"title": "Name",
Expand Down Expand Up @@ -74,8 +74,8 @@
"title": "Identifier",
"type": "object"
},
"PropertyModel": {
"description": "A description of a property.",
"QACategoryModel": {
"description": "A description of a quality attribute category.",
"properties": {
"name": {
"title": "Name",
Expand Down Expand Up @@ -122,7 +122,7 @@
"name",
"module"
],
"title": "PropertyModel",
"title": "QACategoryModel",
"type": "object"
},
"ResultModel": {
Expand Down Expand Up @@ -167,13 +167,13 @@
"title": "Artifact Type",
"type": "string"
},
"properties": {
"type": "array",
"qa_categories": {
"default": [],
"items": {
"$ref": "#/$defs/PropertyModel"
"$ref": "#/$defs/QACategoryModel"
},
"default": [],
"title": "Properties"
"title": "Qa Categories",
"type": "array"
}
},
"title": "SpecModel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"title": "Tags",
"type": "array"
},
"property_category": {
"qa_category": {
"anyOf": [
{
"type": "string"
Expand All @@ -107,9 +107,9 @@
}
],
"default": null,
"title": "Property Category"
"title": "Qa Category"
},
"property": {
"quality_attribute": {
"anyOf": [
{
"type": "string"
Expand All @@ -119,7 +119,7 @@
}
],
"default": null,
"title": "Property"
"title": "Quality Attribute"
},
"code_type": {
"$ref": "#/$defs/CatalogEntryType"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
</p>
<UsaTextInput v-model="requirement.quality">
<template #label>
<b>System Quality:</b> What is the model property to be tested, such
<b>System Quality:</b> What is the model quality attribute category to be tested, such
as accuracy, performance, robustness, fairness, or resource
consumption?
<InfoIcon>
Property by which the model will be evaluated in the context of the
Quality attribute category by which the model will be evaluated in the context of the
system <br />
(e.g., Accuracy, Performance, Robustness, Fairness, Resource
Consumption).
Expand All @@ -54,7 +54,7 @@
<UsaTextInput v-model="requirement.stimulus">
<template #label>
<b>Stimulus:</b> What is the input to the model, the action, or the
event that will enable testing of the property, such as input data,
event that will enable testing of the quality attribute category, such as input data,
system event, or user operation?
<InfoIcon>
A condition arriving at the system/model (e.g., data,
Expand Down
Loading

0 comments on commit 96b5d5e

Please sign in to comment.