forked from aws/amazon-sagemaker-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize rule constructor to take trials/strings. Improve rule inv…
…oker (aws#77) * WIP, added tf and core * WIP * add code from all repos, and fix imports * fix more imports, add tests * add docs, examples * fix imports in examples * fix setup.py and CI * fix test invoker * Reload a step directory when it was last seen as empty (aws#117) * fix imports * fix new imports * unskip test * Add setup.py * undo end of training merge * remove import * Add training end code * add frameworks * fix function used * update setup to use append * fixing small errors (aws#74) * testing * testing * testing * testing * testing * testing * testing * trigger ci * trigger ci * trigger ci * trigger ci * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * uploading test reports to s3 * uploading test reports to s3 * uploading test reports to s3 * uploading test reports to s3 * changes * changes * docs * Add subpackages in core * docs and examples * provides trials and rules as part of main namescope * move rules and trials outside * fix training end tests, and update setup.py * new readme for whole repo * fix setup.py * update packages * make the mxnet tests faster * reduce lenght of integration tests * add script to build binaries * update argument * change num steps and frequency * delete path * add boto3 * fix training end tests * changes * refactor rules, rule_invoker to take any argument from the rule * cleanup * move exceptions to its own module * fix links * update readme * update version string in setup.py * uncommented test * making the pytorch stuff up to date (aws#79) * making the pytorch stuff up to date * reverting util.py * fixing the hook imports * fixing test imports * fix increment of step * training_has_ended fix for pytorch (aws#80) * making the pytorch stuff up to date * Revert "making the pytorch stuff up to date" This reverts commit f87f9560b5351f135553072c495f2123964b9f3c. * changing to training_has_ended * fix comparision in allzero * Unchanged tensor rule (aws#82) * WIP unchanged tensor * WIP * WIP2 * add test for the rule * fix steps mess in rule * add rule invocation to readme * add doc * review comments * remove new exception
- Loading branch information
Showing
14 changed files
with
305 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from tests.analysis.utils import generate_data | ||
|
||
from tornasole.rules.generic import UnchangedTensor | ||
from tornasole.trials import create_trial | ||
import uuid | ||
import numpy as np | ||
from tornasole.exceptions import * | ||
from tornasole.rules.rule_invoker import invoke_rule | ||
|
||
def test_unchanged(): | ||
run_id = str(uuid.uuid4()) | ||
base_path = 'ts_output/rule_invoker/' | ||
path = base_path + run_id | ||
|
||
num_tensors = 3 | ||
|
||
shape = (10, 3, 2) | ||
generate_data(path=base_path, trial=run_id, num_tensors=num_tensors, | ||
step=0, tname_prefix='foo', worker='algo-1', shape=shape, | ||
data=np.ones(shape=shape)) | ||
generate_data(path=base_path, trial=run_id, num_tensors=num_tensors, | ||
step=1, tname_prefix='foo', worker='algo-1', shape=shape, | ||
data=np.ones(shape=shape)) | ||
generate_data(path=base_path, trial=run_id, num_tensors=num_tensors, | ||
step=2, tname_prefix='foo', worker='algo-1', shape=shape, | ||
data=np.ones(shape=shape)) | ||
|
||
generate_data(path=base_path, trial=run_id, num_tensors=num_tensors, | ||
step=5, tname_prefix='boo', worker='algo-1', shape=shape, | ||
data=np.ones(shape=shape)) | ||
|
||
tr = create_trial(path) | ||
r = UnchangedTensor(tr, tensor_regex='.*') | ||
|
||
invoke_rule(r, start_step=0, end_step=2, raise_eval_cond=True) | ||
|
||
try: | ||
invoke_rule(r, start_step=0, end_step=3, raise_eval_cond=True) | ||
assert False | ||
except RuleEvaluationConditionMet: | ||
pass | ||
|
||
try: | ||
invoke_rule(r, start_step=2, end_step=3, raise_eval_cond=True) | ||
assert False | ||
except RuleEvaluationConditionMet: | ||
pass | ||
|
||
invoke_rule(r, start_step=3, end_step=6, raise_eval_cond=True) |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
from .rule import RequiredTensors, Rule | ||
from .rule_invoker import invoke_rule |
Oops, something went wrong.