Skip to main content

SMDebug RulesConfig

Project description

SageMaker-Debugger-RulesConfig

Sagemaker-debugger is an upcoming AWS service designed to be a debugger for machine learning models. It lets you go beyond just looking at scalars like losses and accuracies during training and gives you full visibility into all tensors 'flowing through the graph' during training or inference.

SageMaker Debugger RulesConfig provides a mapping of builtin rules with default configurations. These configurations will affect both DebugHookConfig and DebugRuleConfigurations in the SageMaker Python SDK.

This library, intended to be used with SageMaker PySDK, helps you specify builtin rules without worrying about any details or tweak the configuration of builtin rules. These builtin rules are available in SageMaker.

SageMaker Debugger Rulesconfig package can be used with SageMaker Debugger or as stand-alone rule config retriever too. In addition to retrieving builtin rules, configuration for common collections can be retrieved as well.

Example: Vanilla builtin rule without customization

from sagemaker.debug import Rule
from smdebug_rulesconfig import vanishing_gradient

my_estimator = Estimator(
    ...
    rules=[Rule.sagemaker(vanishing_gradient())]
)

Example: Builtin rule with customization

my_estimator = Estimator(
    ...
    rules= [
        Rule.sagemaker(vanishing_gradient()),
        Rule.sagemaker(
            base_config=weight_update_ratio(),
            instance_type="t2.micro",
            name="my_wup_rule_name",
            container_local_path="/local/path",
            s3_output_path="s3://uri",
            volume_size_in_gb=100,
            rule_parameters={
                "param1": "value1",
                "param2": "value2"
            },
            collection_configurations=[
                CollectionConfiguration(
                    name="my_name",  # Required
                    parameters= {
                        "param1": "value1",
                        "param2": "value2"
                    }  # Required
                )
            ],
        )
    ],
    wait=False
)

Example: Builtin rule with collection configuration specified

from smdebug_rulesconfig import get_collection

my_estimator = Estimator(
    ...
    rules= [
        Rule.sagemaker(
            base_config=vanishing_gradient(),
            collection_configurations=[
                get_collection("weights")
            ],
        )
    ],
    wait=False
)

License

This project is licensed under the Apache-2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smdebug_rulesconfig-0.1.2.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

smdebug_rulesconfig-0.1.2-py2.py3-none-any.whl (10.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page