← Python API
vraven.decompiler · class

AdversarialAuditor

AdversarialAuditor(model: 'nn.Module', *, model_name: 'str | None' = None, output_path: 'str | Sequence[str | int] | None' = None) -> 'None'

Audit a live PyTorch model with a measured adversarial stress suite.

Usage

from vraven.decompiler import AdversarialAuditor

value = AdversarialAuditor(...)

Methods

audit_autoattack(self, x: 'Tensor', *, epsilon: 'float' = 0.1, steps: 'int' = 20, clip_min: 'float | None' = None, clip_max: 'float | None' = None, seed: 'int' = 24032026, square_queries: 'int' = 200, fab_iters: 'int' = 40, fab_restarts: 'int' = 2, n_target_classes: 'int' = 3, target: 'int | None' = None) -> 'AdversarialAuditReport'

Run the fixed-ε VRAVEN ensemble-lite pilot protocol.

audit_batch(self, x: 'Tensor', y: 'Tensor | np.ndarray | Sequence[int] | None' = None, *, epsilon: 'float' = 0.1, protocol: 'str' = 'vraven_ensemble_lite', max_samples: 'int | None' = None, sampling: 'str' = 'stratified', sample_indices: 'Sequence[int] | None' = None, clip_min: 'float | None' = None, clip_max: 'float | None' = None, seed: 'int' = 24032026, steps: 'int' = 10, pgd_restarts: 'int' = 1, square_queries: 'int' = 80, fab_iters: 'int' = 15, fab_restarts: 'int' = 1, n_target_classes: 'int' = 2) -> 'RobustAccuracyReport'

Estimate overall and clean-conditional robustness at fixed L∞ ε.

audit_robustness_curve(self, x: 'Tensor', y: 'Tensor | np.ndarray | Sequence[int]', *, epsilon_grid: 'Sequence[float]' = (0.01, 0.05, 0.1, 0.25), protocol: 'str' = 'vraven_ensemble_lite', max_samples: 'int | None' = None, sampling: 'str' = 'stratified', clip_min: 'float | None' = None, clip_max: 'float | None' = None, seed: 'int' = 24032026, **attack_budgets: 'Any') -> 'RobustnessProfileReport'

Evaluate a matched cohort across ε and build a monotone RA profile.

audit_sample(self, x: 'Tensor', y: 'int | Tensor | None' = None, *, target: 'int | None' = None, epsilon_grid: 'Sequence[float]' = (0.01, 0.05, 0.1, 0.25, 0.5), pgd_steps: 'int' = 10, pgd_restarts: 'int' = 1, pgd_step_size: 'float | None' = None, clip_min: 'float | None' = None, clip_max: 'float | None' = None, concept_directions: 'Tensor | np.ndarray | None' = None, concept_names: 'Sequence[str] | None' = None, seed: 'int' = 24032026, run_pgd: 'bool' = True, attacks: 'Sequence[str] | None' = None, deepfool_iters: 'int' = 40, square_queries: 'int' = 80, fab_iters: 'int' = 20, fab_restarts: 'int' = 2, n_target_classes: 'int' = 3, mechanism_probe: 'MechanismProbe | None' = None, mechanism_unit_names: 'Sequence[str] | None' = None, mechanism_probe_kind: 'str | None' = None, instability_tau: 'float' = 0.7, instability_metric: 'str' = 'mechanism_survival', use_concept_directions_as_mechanism: 'bool' = False) -> 'AdversarialAuditReport'

Run Layer-1 stress suite + Layer-2 frozen-M ΔM analysis.

Source of truthThis page is generated from the checked-out public symbol, signature, and docstring. Pin the package version for reproducible work.