Repository Analysis

meta-pytorch/captum

Model interpretability and understanding for PyTorch

22.1 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of meta-pytorch/captum, a Python project with 5,680 GitHub stars. SynthScan v2.0 examined 77,428 lines of code across 288 source files, recording 1264 pattern matches distributed across 18 syntactic categories. The overall adjusted score of 22.1 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

22.1
Adjusted Score
22.1
Raw Score
100%
Time Factor
2026-07-31
Last Push
5.7K
Stars
Python
Language
77.4K
Lines of Code
288
Files
1.3K
Pattern Hits
2026-08-02
Scan Date
0.39
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 11HIGH 102MEDIUM 9LOW 1142

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1264 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers851 hits · 795 pts
SeverityFileLineSnippetContext
LOWtests/test_tutorial_regressions.py24def test_titanic_tutorial_models_return_logits_for_cross_entropy_loss() -> None:CODE
LOWtests/test_insights_retired.py16 def test_import_insights_module(self) -> None:CODE
LOWtests/test_insights_retired.py22 def test_attribution_visualizer_raises(self) -> None:CODE
LOWtests/test_insights_retired.py51 def test_error_message_includes_migration_guidance(self) -> None:CODE
LOWtests/metrics/test_sensitivity.py72 def test_basic_sensitivity_max_single(self) -> None:CODE
LOWtests/metrics/test_sensitivity.py85 def test_basic_sensitivity_max_multiple(self) -> None:CODE
LOWtests/metrics/test_sensitivity.py98 def test_basic_sensitivity_max_multiple_gradshap(self) -> None:CODE
LOWtests/metrics/test_sensitivity.py124 def test_convnet_multi_target(self) -> None:CODE
LOWtests/metrics/test_sensitivity.py143 def test_convnet_multi_target_and_default_pert_func(self) -> None:STRING
LOWtests/metrics/test_sensitivity.py174 def test_sensitivity_max_multi_dim(self) -> None:STRING
LOWtests/metrics/test_sensitivity.py194 def test_sensitivity_max_multi_dim_batching(self) -> None:STRING
LOWtests/metrics/test_sensitivity.py226 def test_sensitivity_additional_forward_args_multi_args(self) -> None:STRING
LOWtests/metrics/test_sensitivity.py256 def test_classification_sensitivity_tpl_target_w_baseline(self) -> None:STRING
LOWtests/metrics/test_sensitivity.py287 def test_sensitivity_max_with_feature_mask(self) -> None:STRING
LOWtests/metrics/test_infidelity.py36def _local_perturb_func_default(CODE
LOWtests/metrics/test_infidelity.py121 def test_basic_infidelity_single(self) -> None:CODE
LOWtests/metrics/test_infidelity.py129 def test_basic_infidelity_multiple(self) -> None:CODE
LOWtests/metrics/test_infidelity.py145 def test_basic_infidelity_multiple_with_batching(self) -> None:CODE
LOWtests/metrics/test_infidelity.py210 def test_classification_infidelity_convnet_multi_targets(self) -> None:CODE
LOWtests/metrics/test_infidelity.py228 def test_classification_infidelity_tpl_target(self) -> None:CODE
LOWtests/metrics/test_infidelity.py261 def test_classification_infidelity_tpl_target_w_baseline(self) -> None:CODE
LOWtests/metrics/test_infidelity.py313 def test_basic_infidelity_multiple_with_normalize(self) -> None:CODE
LOWtests/metrics/test_infidelity.py346 def basic_multilayer_sensitivity_n(CODE
LOWtests/metrics/test_infidelity.py455 def basic_model_global_assert(CODE
LOWtests/robust/test_attack_comparator.py74 def test_attack_comparator_basic(self) -> None:CODE
LOWtests/robust/test_attack_comparator.py125 def test_attack_comparator_with_preproc(self) -> None:CODE
LOWtests/robust/test_attack_comparator.py165 def test_attack_comparator_with_additional_args(self) -> None:CODE
LOWtests/robust/test_FGSM.py91 def test_attack_label_listtuple(self) -> None:CODE
LOWtests/robust/test_FGSM.py105 def test_attack_additional_inputs(self) -> None:CODE
LOWtests/robust/test_FGSM.py144 def test_attack_masked_tensor(self) -> None:CODE
LOWtests/robust/test_FGSM.py152 def test_attack_masked_multiinput(self) -> None:CODE
LOWtests/robust/test_FGSM.py167 def test_attack_masked_loss_defined(self) -> None:CODE
LOWtests/robust/test_min_param_perturbation.py51 def test_minimal_pert_basic_linear(self) -> None:CODE
LOWtests/robust/test_min_param_perturbation.py71 def test_minimal_pert_basic_binary(self) -> None:CODE
LOWtests/robust/test_min_param_perturbation.py95 def test_minimal_pert_preproc(self) -> None:CODE
LOWtests/robust/test_min_param_perturbation.py114 def test_minimal_pert_alt_correct(self) -> None:CODE
LOWtests/robust/test_min_param_perturbation.py150 def test_minimal_pert_additional_forward_args(self) -> None:CODE
LOWtests/robust/test_min_param_perturbation.py190 def test_minimal_pert_tuple_test(self) -> None:CODE
LOWtests/robust/test_PGD.py125 def test_attack_masked_nontargeted(self) -> None:CODE
LOWtests/robust/test_PGD.py139 def test_attack_masked_targeted(self) -> None:CODE
LOWtests/robust/test_PGD.py153 def test_attack_masked_multiinput(self) -> None:CODE
LOWtests/robust/test_PGD.py173 def test_attack_masked_random_start(self) -> None:CODE
LOWtests/robust/test_PGD.py210 def test_attack_masked_loss_defined(self) -> None:CODE
LOWtests/influence/_utils/test_common.py21 def test_jacobian_loss_wrt_inputs(self) -> None:CODE
LOWtests/influence/_core/test_tracin_k_most_influential.py90 def test_tracin_k_most_influential(CODE
LOW…sts/influence/_core/test_tracin_aggregate_influence.py41 def test_tracin_aggregate_influence(CODE
LOW…sts/influence/_core/test_tracin_aggregate_influence.py102 def test_tracin_aggregate_influence_api(CODE
LOWtests/influence/_core/test_tracin_self_influence.py162 def test_tracin_self_influence(CODE
LOWtests/influence/_core/test_tracin_self_influence.py251 def test_tracin_self_influence_dataloader_vs_single_batch(CODE
LOWtests/influence/_core/test_tracin_validation.py43 def test_tracin_require_inputs_dataset(CODE
LOWtests/influence/_core/test_tracin_validation.py73 def test_tracincp_fast_rand_proj_inputs(self) -> None:CODE
LOWtests/influence/_core/test_tracin_validation.py103 def test_tracincp_input_checkpoints(CODE
LOWtests/influence/_core/test_tracin_regression.py38 def _test_tracin_regression_setup(CODE
LOWtests/influence/_core/test_tracin_regression.py342 def _test_tracin_identity_regression_setup(STRING
LOWtests/influence/_core/test_tracin_regression.py388 def test_tracin_identity_regression(STRING
LOWtests/influence/_core/test_tracin_regression.py499 def test_tracin_constant_test_loss_fn(STRING
LOWtests/influence/_core/test_tracin_show_progress.py39 def _check_error_msg_multiplicity(CODE
LOWtests/influence/_core/test_tracin_show_progress.py111 def test_tracin_show_progress(CODE
LOW…influence/_core/test_tracin_intermediate_quantities.py45 def test_tracin_intermediate_quantities_aggregate(CODE
LOW…influence/_core/test_tracin_intermediate_quantities.py106 def test_tracin_intermediate_quantities_api(CODE
791 more matches not shown…
Docstring Block Structure51 hits · 255 pts
SeverityFileLineSnippetContext
HIGHcaptum/metrics/_core/infidelity.py72 Args: perturb_func(Callable): Input perturbation function that takes inputs and opSTRING
HIGHcaptum/metrics/_core/infidelity.py161 Explanation infidelity represents the expected mean-squared error between the explanation multiplied by a meaniSTRING
HIGHcaptum/metrics/_core/sensitivity.py80 Explanation sensitivity measures the extent of explanation change when the input is slightly perturbed. It has STRING
HIGHcaptum/robust/_core/metrics/attack_comparator.py270 Evaluate model and attack performance on provided inputs Args: inputs (Any): Input for whSTRING
HIGHcaptum/robust/_core/metrics/min_param_perturbation.py385 This method evaluates the model at each perturbed input and identifies the minimum perturbation that leSTRING
HIGHcaptum/attr/_utils/visualization.py447 Visualizes attribution for a given image by normalizing attribution values of the desired sign (positive, negatSTRING
HIGHcaptum/attr/_utils/visualization.py667 Visualizes attribution using multiple visualization methods displayed in a 1 x k grid, where k is the number ofSTRING
HIGHcaptum/attr/_utils/visualization.py913 Visualizes attribution for a given timeseries data by normalizing attribution values of the desired sign (positSTRING
HIGHcaptum/attr/_core/feature_ablation.py307 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which ablation attriSTRING
HIGHcaptum/attr/_core/feature_permutation.py121 This function is almost equivalent to :func:`FeatureAblation.attribute <captum.attr.FeatureAblation.attSTRING
HIGHcaptum/attr/_core/occlusion.py69 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which occlusion STRING
HIGHcaptum/attr/_core/gradient_shap.py135 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which SHAP attribution STRING
HIGHcaptum/attr/_core/lime.py258 This method attributes the output of the model with given target index (in case it is provided, otherwiSTRING
HIGHcaptum/attr/_core/lime.py944 This method attributes the output of the model with given target index (in case it is provided, otherwiSTRING
HIGHcaptum/attr/_core/noise_tunnel.py103 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which integrated grSTRING
HIGHcaptum/attr/_core/guided_backprop_deconvnet.py156 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/guided_backprop_deconvnet.py265 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/lrp.py110 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which relevance is STRING
HIGHcaptum/attr/_core/guided_grad_cam.py84 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/shapley_value.py142 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which Shapley value STRING
HIGHcaptum/attr/_core/shapley_value.py1068 NOTE: The feature_mask argument differs from other perturbation based methods, since feature indices caSTRING
HIGHcaptum/attr/_core/deep_lift.py1071 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/deep_lift.py1564 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/remote_provider.py124 Generate text using the vLLM API. Args: prompt: The input prompt for text generation STRING
HIGHcaptum/attr/_core/remote_provider.py171 Get the log probabilities for all tokens in the target string. Args: input_prompt: The inpSTRING
HIGHcaptum/attr/_core/saliency.py51 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which saliency is cSTRING
HIGHcaptum/attr/_core/kernel_shap.py72 This method attributes the output of the model with given target index (in case it is provided, otherwiSTRING
HIGHcaptum/attr/_core/kernel_shap.py442 This method attributes the output of the model with given target index (in case it is provided, otherwiSTRING
HIGHcaptum/attr/_core/input_x_gradient.py45 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/integrated_gradients.py124 This method attributes the output of the model with given target index (in case it is provided, otherwiSTRING
HIGHcaptum/attr/_core/neuron/neuron_gradient.py76 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which neuron gradieSTRING
HIGH…/attr/_core/neuron/neuron_guided_backprop_deconvnet.py77 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGH…/attr/_core/neuron/neuron_guided_backprop_deconvnet.py235 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/neuron/neuron_feature_ablation.py83 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which neuron attribSTRING
HIGHcaptum/attr/_core/neuron/neuron_gradient_shap.py118 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which SHAP attribution STRING
HIGHcaptum/attr/_core/neuron/neuron_deep_lift.py101 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer attribuSTRING
HIGHcaptum/attr/_core/neuron/neuron_deep_lift.py336 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer attribuSTRING
HIGHcaptum/attr/_core/neuron/neuron_integrated_gradients.py95 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which neuron integrated STRING
HIGHcaptum/attr/_core/neuron/neuron_conductance.py120 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which neuron conducSTRING
HIGHcaptum/attr/_core/layer/internal_influence.py86 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which internal inflSTRING
HIGHcaptum/attr/_core/layer/layer_lrp.py127 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which relevance is STRING
HIGHcaptum/attr/_core/layer/layer_activation.py61 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer activatSTRING
HIGHcaptum/attr/_core/layer/layer_conductance.py130 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer conductSTRING
HIGHcaptum/attr/_core/layer/grad_cam.py95 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/layer/layer_gradient_x_activation.py94 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which attributions STRING
HIGHcaptum/attr/_core/layer/layer_gradient_shap.py159 Args: inputs (Tensor or tuple[Tensor, ...]): Input which are used to compute STRING
HIGHcaptum/attr/_core/layer/layer_feature_ablation.py82 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer attribuSTRING
HIGHcaptum/attr/_core/layer/layer_integrated_gradients.py340 This method attributes the output of the model with given target index (in case it is provided, otherwiSTRING
HIGHcaptum/attr/_core/layer/layer_deep_lift.py146 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer attribuSTRING
HIGHcaptum/attr/_core/layer/layer_deep_lift.py488 Args: inputs (Tensor or tuple[Tensor, ...]): Input for which layer attribuSTRING
HIGHcaptum/attr/_models/base.py163 This method wraps a model's embedding layer with an interpretable embedding layer that allows us to access the STRING
Cross-File Repetition39 hits · 195 pts
SeverityFileLineSnippetContext
HIGHtests/attr/test_targets.py0tests in this file are dynamically generated based on the config defined in captum/testing/attr/helpers/test_config.py. STRING
HIGHtests/attr/test_data_parallel.py0tests in this file are dynamically generated based on the config defined in captum/testing/attr/helpers/test_config.py. STRING
HIGHtests/attr/test_jit.py0tests in this file are dynamically generated based on the config defined in captum/testing/attr/helpers/test_config.py. STRING
HIGHtests/attr/test_hook_removal.py0tests in this file are dynamically generated based on the config defined in captum/testing/attr/helpers/test_config.py. STRING
HIGHcaptum/influence/_core/influence_function.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/influence/_core/arnoldi_influence_function.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/influence/_core/tracincp.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/influence/_core/tracincp_fast_rand_proj.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/influence/_core/influence_function.py0this is the key method of this class, and can be run in 2 different modes, where the mode that is run depends on the argSTRING
HIGHcaptum/influence/_core/arnoldi_influence_function.py0this is the key method of this class, and can be run in 2 different modes, where the mode that is run depends on the argSTRING
HIGHcaptum/influence/_core/tracincp.py0this is the key method of this class, and can be run in 2 different modes, where the mode that is run depends on the argSTRING
HIGHcaptum/influence/_core/tracincp_fast_rand_proj.py0this is the key method of this class, and can be run in 2 different modes, where the mode that is run depends on the argSTRING
HIGHcaptum/influence/_core/influence_function.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/influence/_core/arnoldi_influence_function.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/influence/_core/tracincp.py0args: inputs (tuple): `inputs` is the test batch and is a tuple of any, where the last element is assumed to be the labeSTRING
HIGHcaptum/attr/_core/feature_ablation.py0args: forward_func (callable): the forward function of the model or any modification of it.STRING
HIGHcaptum/attr/_core/occlusion.py0args: forward_func (callable): the forward function of the model or any modification of it.STRING
HIGHcaptum/attr/_core/saliency.py0args: forward_func (callable): the forward function of the model or any modification of it.STRING
HIGHcaptum/attr/_core/kernel_shap.py0args: forward_func (callable): the forward function of the model or any modification of it.STRING
HIGHcaptum/attr/_core/guided_backprop_deconvnet.py0args: inputs (tensor or tuple[tensor, ...]): input for which attributions are computed. if forward_func takes a single tSTRING
HIGHcaptum/attr/_core/saliency.py0args: inputs (tensor or tuple[tensor, ...]): input for which attributions are computed. if forward_func takes a single tSTRING
HIGHcaptum/attr/_core/input_x_gradient.py0args: inputs (tensor or tuple[tensor, ...]): input for which attributions are computed. if forward_func takes a single tSTRING
HIGHcaptum/attr/_core/deep_lift.py0implements deeplift algorithm for the layer based on the following paper: learning important features through propagatinSTRING
HIGHcaptum/attr/_core/neuron/neuron_deep_lift.py0implements deeplift algorithm for the layer based on the following paper: learning important features through propagatinSTRING
HIGHcaptum/attr/_core/layer/layer_deep_lift.py0implements deeplift algorithm for the layer based on the following paper: learning important features through propagatinSTRING
HIGHcaptum/attr/_core/neuron/neuron_gradient.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGH…/attr/_core/neuron/neuron_guided_backprop_deconvnet.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/internal_influence.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/layer_conductance.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/layer_activation.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/layer_feature_permutation.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/layer_feature_ablation.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/neuron/neuron_gradient_shap.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/neuron/neuron_integrated_gradients.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/neuron/neuron_conductance.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/layer_gradient_shap.py0args: forward_func (callable): the forward function of the model or any modification of it layer (torch.nn.module): layeSTRING
HIGHcaptum/attr/_core/layer/internal_influence.py0this method attributes the output of the model with given target index (in case it is provided, otherwise it assumes thaSTRING
HIGHcaptum/attr/_core/layer/layer_conductance.py0this method attributes the output of the model with given target index (in case it is provided, otherwise it assumes thaSTRING
HIGHcaptum/attr/_core/layer/layer_integrated_gradients.py0this method attributes the output of the model with given target index (in case it is provided, otherwise it assumes thaSTRING
Hallucination Indicators11 hits · 145 pts
SeverityFileLineSnippetContext
CRITICALtests/influence/_core/test_dataloader.py45 # captum.testing.helpers.influence.common.DataInfluenceConstructor(captum.influence._core.COMMENT
CRITICALtests/influence/_core/test_dataloader.py47 # captum.testing.helpers.influence.common.DataInfluenceConstructor(COMMENT
CRITICALtests/influence/_core/test_tracin_k_most_influential.py84 # `captum.testing.helpers.influence.common.build_test_name_func()`COMMENT
CRITICALtests/influence/_core/test_tracin_xor.py234 # `captum.testing.helpers.influence.common.build_test_name_func($parameter$args_to_skipCOMMENT
CRITICALtests/influence/_core/test_tracin_regression.py267 # `captum.testing.helpers.influence.common.build_test_name_func()`COMMENT
CRITICALtests/influence/_core/test_tracin_regression.py359 # `captum.testing.helpers.influence.common.build_test_name_func()`STRING
CRITICALtests/influence/_core/test_tracin_regression.py474 # `captum.testing.helpers.influence.common.build_test_name_func()`STRING
CRITICALtests/attr/test_llm_attr.py175 self.trans.self_attn.in_proj_bias.data.fill_(0.0)CODE
CRITICALtests/attr/test_llm_attr.py179 self.trans.self_attn.out_proj.bias.data.fill_(0.0)CODE
CRITICALtests/attr/test_llm_attr.py182 self.trans.linear1.bias.data.fill_(0.0)CODE
CRITICALtests/attr/test_llm_attr.py185 self.trans.linear2.bias.data.fill_(0.0)CODE
Unused Imports166 hits · 136 pts
SeverityFileLineSnippetContext
LOWtests/test_insights_retired.py10CODE
LOWtests/utils/test_progress.py35CODE
LOWtests/utils/test_progress.py53CODE
LOWtests/attr/test_jit.py10CODE
LOWtests/attr/test_deconvolution.py10CODE
LOWtests/attr/neuron/test_neuron_deeplift.py10CODE
LOWtests/attr/models/test_base.py10CODE
LOWtests/attr/layer/test_layer_deeplift.py10CODE
LOWtests/concept/test_tcav.py1255CODE
LOWcaptum/__init__.py4CODE
LOWcaptum/__init__.py5CODE
LOWcaptum/__init__.py6CODE
LOWcaptum/__init__.py7CODE
LOWcaptum/__init__.py8CODE
LOWcaptum/__init__.py9CODE
LOWcaptum/metrics/__init__.py5CODE
LOWcaptum/metrics/__init__.py5CODE
LOWcaptum/metrics/__init__.py9CODE
LOWcaptum/_utils/models/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/_utils/models/linear_model/__init__.py2CODE
LOWcaptum/insights/__init__.py27CODE
LOWcaptum/robust/__init__.py5CODE
LOWcaptum/robust/__init__.py6CODE
LOWcaptum/robust/__init__.py7CODE
LOWcaptum/robust/__init__.py8CODE
LOWcaptum/robust/__init__.py9CODE
LOWcaptum/influence/__init__.py5CODE
LOWcaptum/influence/__init__.py6CODE
LOWcaptum/influence/__init__.py7CODE
LOWcaptum/influence/__init__.py8CODE
LOWcaptum/influence/__init__.py8CODE
LOWcaptum/influence/__init__.py9CODE
LOWcaptum/influence/__init__.py9CODE
LOWcaptum/influence/_utils/common.py38CODE
LOWcaptum/influence/_utils/common.py38CODE
LOWcaptum/influence/_utils/common.py42CODE
LOWcaptum/influence/_utils/common.py42CODE
LOWcaptum/module/__init__.py2CODE
LOWcaptum/module/__init__.py3CODE
LOWcaptum/module/__init__.py4CODE
LOWcaptum/testing/helpers/__init__.py6CODE
LOWcaptum/testing/helpers/__init__.py14CODE
LOWcaptum/testing/helpers/influence/common.py649CODE
LOWcaptum/attr/__init__.py4CODE
LOWcaptum/attr/__init__.py5CODE
LOWcaptum/attr/__init__.py5CODE
LOWcaptum/attr/__init__.py6CODE
LOWcaptum/attr/__init__.py7CODE
LOWcaptum/attr/__init__.py8CODE
LOWcaptum/attr/__init__.py9CODE
LOWcaptum/attr/__init__.py9CODE
LOWcaptum/attr/__init__.py10CODE
106 more matches not shown…
Deep Nesting51 hits · 51 pts
SeverityFileLineSnippetContext
LOWtests/influence/_core/test_tracin_show_progress.py111CODE
LOWtests/influence/_core/test_arnoldi_influence.py129CODE
LOWtests/influence/_core/test_arnoldi_influence.py436CODE
LOWtests/utils/test_sample_gradient.py100CODE
LOWtests/attr/test_targets.py106CODE
LOWtests/attr/test_targets.py142CODE
LOWtests/attr/test_hook_removal.py71CODE
LOWtests/attr/test_data_parallel.py211CODE
LOWtests/attr/test_data_parallel.py71CODE
LOWtests/attr/test_jit.py90CODE
LOWtests/attr/test_jit.py134CODE
LOWtests/attr/test_jit.py147CODE
LOWtests/attr/test_feature_ablation.py850CODE
LOWtests/attr/neuron/test_neuron_conductance.py199CODE
LOWtests/attr/neuron/test_neuron_conductance.py250CODE
LOWtests/concept/test_tcav.py787CODE
LOWtests/concept/test_tcav.py915CODE
LOWscripts/parse_tutorials.py43CODE
LOWscripts/parse_sphinx.py42CODE
LOWcaptum/_utils/gradient.py44CODE
LOWcaptum/_utils/gradient.py263CODE
LOWcaptum/_utils/gradient.py955CODE
LOWcaptum/_utils/gradient.py300CODE
LOWcaptum/_utils/gradient.py305CODE
LOWcaptum/_utils/common.py356CODE
LOWcaptum/_utils/common.py618CODE
LOWcaptum/_utils/common.py772CODE
LOWcaptum/_utils/models/linear_model/train.py103CODE
LOWcaptum/robust/_core/metrics/attack_comparator.py440CODE
LOWcaptum/robust/_core/metrics/min_param_perturbation.py234CODE
LOWcaptum/robust/_core/metrics/min_param_perturbation.py291CODE
LOWcaptum/testing/helpers/basic.py32CODE
LOWcaptum/testing/helpers/basic.py190CODE
LOWcaptum/testing/helpers/influence/common.py345CODE
LOWcaptum/testing/helpers/influence/common.py659CODE
LOWcaptum/attr/_utils/approximation_methods.py48CODE
LOWcaptum/attr/_utils/approximation_methods.py79CODE
LOWcaptum/attr/_utils/visualization.py226CODE
LOWcaptum/attr/_utils/visualization.py274CODE
LOWcaptum/attr/_core/lime.py1181CODE
LOWcaptum/attr/_core/lrp.py306CODE
LOWcaptum/attr/_core/shapley_value.py131CODE
LOWcaptum/attr/_core/shapley_value.py476CODE
LOWcaptum/attr/_core/deep_lift.py306CODE
LOWcaptum/attr/_core/deep_lift.py329CODE
LOWcaptum/attr/_core/deep_lift.py694CODE
LOWcaptum/attr/_core/remote_provider.py165CODE
LOWcaptum/attr/_core/layer/layer_integrated_gradients.py128CODE
LOWcaptum/attr/_core/layer/layer_integrated_gradients.py135CODE
LOWcaptum/concept/_core/cav.py163CODE
LOWcaptum/concept/_core/tcav.py428CODE
Cross-Language Confusion10 hits · 35 pts
SeverityFileLineSnippetContext
HIGHtests/influence/_core/test_tracin_regression.py57 # pyre-fixme[61]: `net_adjusted` is undefined, or not always defined.COMMENT
HIGHtests/influence/_core/test_tracin_regression.py554 # pyre-fixme[61]: `test_loss_fn` is undefined, or not always defined.STRING
HIGHcaptum/_utils/gradient.py941 # pyre-fixme[61]: `layer_parameters` is undefined, or not alwaysSTRING
HIGHcaptum/_utils/gradient.py1059 # pyre-fixme[61]: `layer_parameters` is undefined, or not alwaysSTRING
HIGHcaptum/influence/_core/arnoldi_influence_function.py155 # pyre-fixme[61]: `k` is undefined, or not always defined.STRING
HIGHcaptum/influence/_core/tracincp_fast_rand_proj.py1550 # pyre-fixme[61]: `jacobian_projection` is undefined, or notSTRING
HIGHcaptum/influence/_core/tracincp_fast_rand_proj.py1554 # pyre-fixme[61]: `layer_input_projection` is undefined, or notSTRING
HIGHcaptum/testing/helpers/basic_models.py343 # pyre-fixme[61]: `another_embedding` is undefined, or not always defined.STRING
HIGHcaptum/testing/helpers/influence/common.py491 # pyre-fixme[61]: `net_adjusted` is undefined, or not always defined.COMMENT
HIGHcaptum/concept/_utils/classifier.py189 # pyre-fixme[61]: `input` is undefined, or not always defined.STRING
AI Structural Patterns34 hits · 32 pts
SeverityFileLineSnippetContext
LOWtests/metrics/test_infidelity.py486CODE
LOWtests/utils/test_linear_model.py28CODE
LOWtests/attr/test_lime.py526CODE
LOWtests/attr/test_kernel_shap.py530CODE
LOWtests/attr/test_shapley.py1092CODE
LOWtests/attr/test_shapley.py1139CODE
LOWtests/attr/test_shapley.py356CODE
LOWtests/attr/test_shapley.py444CODE
LOWcaptum/_utils/gradient.py593CODE
LOWcaptum/_utils/gradient.py613CODE
LOWcaptum/_utils/gradient.py630CODE
LOWcaptum/_utils/models/linear_model/model.py49CODE
LOWcaptum/_utils/models/linear_model/train.py103CODE
LOWcaptum/influence/_core/influence_function.py698CODE
LOWcaptum/influence/_core/arnoldi_influence_function.py294CODE
LOWcaptum/influence/_core/tracincp_fast_rand_proj.py910CODE
LOWcaptum/attr/_utils/visualization.py397CODE
LOWcaptum/attr/_utils/visualization.py415CODE
LOWcaptum/attr/_utils/visualization.py432CODE
LOWcaptum/attr/_utils/visualization.py895CODE
LOWcaptum/attr/_core/lime.py932CODE
LOWcaptum/attr/_core/lime.py1181CODE
LOWcaptum/attr/_core/dataloader_attr.py265CODE
LOWcaptum/attr/_core/shapley_value.py767CODE
LOWcaptum/attr/_core/shapley_value.py993CODE
LOWcaptum/attr/_core/kernel_shap.py60CODE
LOWcaptum/attr/_core/kernel_shap.py429CODE
LOWcaptum/attr/_core/neuron/neuron_conductance.py103CODE
LOWcaptum/attr/_core/layer/internal_influence.py74CODE
LOWcaptum/attr/_core/layer/layer_conductance.py81CODE
LOWcaptum/attr/_core/layer/layer_conductance.py98CODE
LOWcaptum/attr/_core/layer/layer_conductance.py113CODE
LOWcaptum/attr/_core/layer/layer_integrated_gradients.py300CODE
LOWcaptum/attr/_core/layer/layer_integrated_gradients.py321CODE
Self-Referential Comments6 hits · 20 pts
SeverityFileLineSnippetContext
MEDIUMtests/attr/test_llm_attr.py759 # Create a mock OpenAI clientCOMMENT
MEDIUMcaptum/testing/attr/helpers/conductance_reference.py99 # Create a forward hook in order to attach backward hook to appropriateSTRING
MEDIUMcaptum/attr/_utils/interpretable_input.py773 # Create a dummy mask for compatibilityCOMMENT
MEDIUMcaptum/attr/_utils/interpretable_input.py776 # Create a dummy mask if None is providedCOMMENT
MEDIUMcaptum/attr/_utils/interpretable_input.py778 # Create a mask with all zeros (entire image as one segment)COMMENT
MEDIUMcaptum/concept/_core/tcav.py314 >>> # Define the conceptsCODE
Modern Structural Boilerplate16 hits · 15 pts
SeverityFileLineSnippetContext
LOWcaptum/__init__.py14__all__ = ["attr", "concept", "influence", "log", "metrics", "robust"]CODE
LOWcaptum/metrics/__init__.py11__all__ = [CODE
LOWcaptum/_utils/models/__init__.py4__all__ = [CODE
LOWcaptum/_utils/models/linear_model/__init__.py14__all__ = [CODE
LOWcaptum/robust/__init__.py11__all__ = ["FGSM", "AttackComparator", "MinParamPerturbation", "Perturbation", "PGD"]CODE
LOWcaptum/influence/__init__.py14__all__ = [CODE
LOWcaptum/influence/_utils/common.py1018def _set_attr(obj, names, val) -> None:STRING
LOWcaptum/module/__init__.py6__all__ = [CODE
LOWcaptum/testing/helpers/__init__.py16__all__ = [CODE
LOWcaptum/testing/helpers/basic.py150def set_all_random_seeds(seed: int = 1234) -> None:CODE
LOWcaptum/attr/__init__.py91__all__ = [CODE
LOWcaptum/attr/visualization.py27__all__ = [CODE
LOWcaptum/attr/_models/base.py151def _set_deep_layer_value(obj, layer_names, value) -> None:STRING
LOWcaptum/concept/__init__.py9__all__ = [CODE
LOWcaptum/log/dummy_log.py66def set_environment(env: Union[None, List[str], str]) -> None:CODE
LOWcaptum/log/__init__.py25__all__ = [CODE
Over-Commented Block13 hits · 13 pts
SeverityFileLineSnippetContext
LOWtests/influence/_core/test_dataloader.py41 # [("none", captum.testing.helpers.influence.common.DataInfluenceConstructorCOMMENT
LOWsphinx/source/conf.py1#! /usr/bin/env python3COMMENT
LOWsphinx/source/conf.py101html_theme = "alabaster"COMMENT
LOWsphinx/source/conf.py121#COMMENT
LOWsphinx/source/conf.py141COMMENT
LOWscripts/publish_site.sh61# |-- api/COMMENT
LOWcaptum/influence/_core/influence_function.py521 # this is the factory that accepts a batchCOMMENT
LOWcaptum/influence/_core/influence_function.py1041 # as described in the description for `NaiveInfluenceFunction`, the embeddingCOMMENT
LOWcaptum/influence/_core/arnoldi_influence_function.py541 # first figure out names of params that require gradients. this is need toCOMMENT
LOWcaptum/influence/_core/arnoldi_influence_function.py641 # the Hessian-vector product are actually tuples of tensors representingCOMMENT
LOWcaptum/influence/_core/arnoldi_influence_function.py761 def get_batch_embeddings(batch: List[Tensor]) -> Tensor:COMMENT
LOWcaptum/influence/_core/tracincp_fast_rand_proj.py1381COMMENT
LOWcaptum/attr/_utils/summarizer.py121 return temp if self._is_inputs_tuple else temp[0]COMMENT
Cross-Language Confusion (JS/TS)2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHwebsite/pages/en/index.js156print('IG Attributions:', attributions)CODE
HIGHwebsite/pages/en/index.js157print('Convergence Delta:', delta)CODE
Dead Code2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMcaptum/influence/_core/arnoldi_influence_function.py603CODE
MEDIUMcaptum/influence/_core/arnoldi_influence_function.py609CODE
Excessive Try-Catch Wrapping5 hits · 4 pts
SeverityFileLineSnippetContext
LOWcaptum/influence/_core/tracincp_fast_rand_proj.py236 except Exception as ex:STRING
LOWcaptum/attr/_core/guided_grad_cam.py222 except Exception:STRING
LOWcaptum/attr/_core/remote_provider.py118 except Exception as e:CODE
LOWcaptum/attr/_core/remote_provider.py162 except Exception as e:CODE
LOWcaptum/attr/_core/remote_provider.py247 except Exception as e:CODE
Structural Annotation Overuse2 hits · 2 pts
SeverityFileLineSnippetContext
LOWcaptum/attr/_utils/stat.py227 # NOTE: The following ensures mse is a float tensor.COMMENT
LOWcaptum/attr/_utils/summarizer.py168 # Step 2: get the correct orderSTRING
Verbosity Indicators3 hits · 2 pts
SeverityFileLineSnippetContext
LOWcaptum/attr/_utils/summarizer.py137 # Step 1:STRING
LOWcaptum/attr/_utils/summarizer.py140 # Step 2:STRING
LOWcaptum/attr/_utils/summarizer.py168 # Step 2: get the correct orderSTRING
AI Slop Vocabulary1 hit · 1 pts
SeverityFileLineSnippetContext
MEDIUMcaptum/influence/_core/arnoldi_influence_function.py651 # aforementioned hessian, then `R` would be `vs @ torch.diag(ls ** -0.5)`, i.e.STRING
Redundant / Tautological Comments1 hit · 0 pts
SeverityFileLineSnippetContext
LOWcaptum/attr/_core/llm_attr.py246 # Loop over the data and create a `Text` for each "pixel".STRING