forked from facebookresearch/ReAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Created the following registries as base classes for training reporting: - TrainingReport - PublishingResult - ValidationResult Add `do_validate` & `do_publish` methods to `ModelValidator`, `ModelPublisher`, respectively. This simplifies subclasses as they don't have to create the union type. Reviewed By: czxttkl Differential Revision: D20854559 fbshipit-source-id: 4d626dab6711eee35a12581c4e5bbe307b4985b8
- Loading branch information
1 parent
aee4d09
commit 4548933
Showing
13 changed files
with
207 additions
and
66 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
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
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,19 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. | ||
|
||
from ml.rl.core.dataclasses import dataclass | ||
from ml.rl.core.registry_meta import RegistryMeta | ||
|
||
|
||
class TrainingReport(metaclass=RegistryMeta): | ||
pass | ||
|
||
|
||
@dataclass | ||
class PublishingResult(metaclass=RegistryMeta): | ||
success: bool | ||
|
||
|
||
@dataclass | ||
class ValidationResult(metaclass=RegistryMeta): | ||
should_publish: bool |
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 |
---|---|---|
@@ -1,26 +1,15 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from typing import NamedTuple, Optional | ||
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. | ||
|
||
from ml.rl.core.dataclasses import dataclass | ||
from ml.rl.core.tagged_union import TaggedUnion | ||
|
||
|
||
class NoPublishingResults(NamedTuple): | ||
pass | ||
|
||
|
||
class NoValidationResults(NamedTuple): | ||
pass | ||
from ml.rl.workflow.result_registries import PublishingResult, ValidationResult | ||
|
||
|
||
@dataclass | ||
class PublishingResults(TaggedUnion): | ||
no_publishing_results: Optional[NoPublishingResults] = None | ||
# Add your own validation results type here | ||
class NoPublishingResults(PublishingResult): | ||
__registry_name__ = "no_publishing_results" | ||
|
||
|
||
@dataclass | ||
class ValidationResults(TaggedUnion): | ||
no_validation_results: Optional[NoValidationResults] = None | ||
# Add your own validation results type here | ||
class NoValidationResults(ValidationResult): | ||
__registry_name__ = "no_validation_results" |
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,4 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. | ||
|
||
from ml.rl.core.tagged_union import TaggedUnion # noqa F401 |
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.