nlsq.diagnostics.DiagnosticsConfig¶
- class nlsq.diagnostics.DiagnosticsConfig(level=DiagnosticLevel.BASIC, condition_threshold=100000000.0, correlation_threshold=0.95, imbalance_threshold=1000000.0, vanishing_threshold=1e-06, sloppy_threshold=1e-06, gradient_window_size=100, stagnation_window=10, stagnation_tolerance=0.01, verbose=True, emit_warnings=True)[source]¶
Bases:
objectConfiguration for diagnostic computation.
This frozen dataclass contains all thresholds and settings used by the diagnostic analyzers. Being frozen ensures configuration immutability during analysis.
- level¶
Diagnostic analysis depth.
- Type:
- condition_threshold¶
FIM condition number threshold for practical identifiability. Default: 1e8.
- Type:
- correlation_threshold¶
Correlation coefficient threshold for high correlation warning. Default: 0.95.
- Type:
- vanishing_threshold¶
Relative gradient magnitude threshold for vanishing detection. Default: 1e-6.
- Type:
- sloppy_threshold¶
Eigenvalue ratio threshold for sensitivity classification. Default: 1e-6.
- Type:
- stagnation_tolerance¶
Relative tolerance for detecting gradient stagnation. Default: 0.01 (1% change).
- Type:
Examples
>>> config = DiagnosticsConfig() >>> config.level <DiagnosticLevel.BASIC: 1> >>> config.condition_threshold 100000000.0
>>> config = DiagnosticsConfig( ... level=DiagnosticLevel.FULL, ... condition_threshold=1e10, ... verbose=False, ... ) >>> config.level <DiagnosticLevel.FULL: 2>
- level: DiagnosticLevel¶
- __init__(level=DiagnosticLevel.BASIC, condition_threshold=100000000.0, correlation_threshold=0.95, imbalance_threshold=1000000.0, vanishing_threshold=1e-06, sloppy_threshold=1e-06, gradient_window_size=100, stagnation_window=10, stagnation_tolerance=0.01, verbose=True, emit_warnings=True)¶