-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(component): refact component structure
Signed-off-by: weiwee <wbwmat@gmail.com>
- Loading branch information
Showing
24 changed files
with
264 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from ._info import __provider__, __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__version__ = "2.0.0.alpha" | ||
__provider__ = "fate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
from typing import Literal, Type, TypeVar | ||
|
||
from typing_extensions import Annotated | ||
|
||
GUEST = "guest" | ||
HOST = "host" | ||
ARBITER = "arbiter" | ||
|
||
T_ROLE = Literal["guest", "host", "arbiter"] | ||
T_STAGE = Literal["train", "predict", "default"] | ||
T_LABEL = Literal["trainable"] | ||
|
||
|
||
class STAGES: | ||
TRAIN = "train" | ||
PREDICT = "predict" | ||
DEFAULT = "default" | ||
|
||
|
||
class LABELS: | ||
TRAINABLE = "trainable" | ||
|
||
|
||
class OutputAnnotated: | ||
... | ||
|
||
|
||
class InputAnnotated: | ||
... | ||
|
||
|
||
T = TypeVar("T") | ||
Output = Annotated[T, OutputAnnotated] | ||
Input = Annotated[T, InputAnnotated] | ||
|
||
|
||
class Artifact: | ||
type: str = "artifact" | ||
"""Represents a generic machine learning artifact. | ||
""" | ||
|
||
|
||
class Artifacts: | ||
type: str = "artifacts" | ||
|
||
|
||
class DatasetArtifact(Artifact): | ||
type = "dataset" | ||
"""An artifact representing a machine learning dataset. | ||
""" | ||
|
||
|
||
class DatasetArtifacts(Artifacts): | ||
type = "datasets" | ||
|
||
|
||
class ModelArtifact(Artifact): | ||
type = "model" | ||
"""An artifact representing a machine learning model. | ||
""" | ||
|
||
|
||
class ModelArtifacts(Artifacts): | ||
type = "models" | ||
artifact_type: Type[Artifact] = ModelArtifact | ||
|
||
|
||
class MetricArtifact(Artifact): | ||
type = "metric" | ||
|
||
|
||
class ClassificationMetrics(Artifact): | ||
"""An artifact for storing classification metrics.""" | ||
|
||
type = "classification_metrics" | ||
|
||
|
||
class SlicedClassificationMetrics(Artifact): | ||
"""An artifact for storing sliced classification metrics. | ||
Similar to ``ClassificationMetrics``, tasks using this class are | ||
expected to use log methods of the class to log metrics with the | ||
difference being each log method takes a slice to associate the | ||
``ClassificationMetrics``. | ||
""" | ||
|
||
type = "sliced_classification_metrics" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.