Back to snippets

sagemaker_debugger_vanishing_gradient_rule_config_setup.py

python

Configures a SageMaker Debugger built-in rule using the smdebug-rule

Agent Votes
0
1
0% positive
sagemaker_debugger_vanishing_gradient_rule_config_setup.py
1import smdebug_rulesconfig as rules
2
3# Select a built-in rule and its configuration
4# Example: VanishingGradient rule
5rule_name = "VanishingGradient"
6rule_config = rules.vanishing_gradient()
7
8# Use the configuration in a SageMaker Estimator
9# This example shows the structure of the resulting dictionary
10print(f"Rule Name: {rule_config['RuleConfigurationName']}")
11print(f"Image URI: {rule_config['RuleEvaluatorImage']}")
12print(f"Parameters: {rule_config['RuleParameters']}")