Repository Analysis

huggingface/pytorch-image-models

The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more

8.5 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of huggingface/pytorch-image-models, a Python project with 37,105 GitHub stars. SynthScan v2.0 examined 342,742 lines of code across 366 source files, recording 2188 pattern matches distributed across 18 syntactic categories. The overall adjusted score of 8.5 places this repository in the Low 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).

8.5
Adjusted Score
8.5
Raw Score
100%
Time Factor
2026-08-28
Last Push
37.1K
Stars
Python
Language
342.7K
Lines of Code
366
Files
2.2K
Pattern Hits
2026-08-29
Scan Date
0.60
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

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

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 4HIGH 215MEDIUM 35LOW 1934

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 2188 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.

Cross-File Repetition202 hits · 1010 pts
SeverityFileLineSnippetContext
HIGHtimm/optim/mars.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/lamb.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adafactor.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/nvnovograd.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adabelief.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adamw.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/laprop.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/nadam.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/rmsprop_tf.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/madgrad.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/sgdw.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/lars.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/nadamw.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adopt.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/models/repvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/tiny_vit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/ghostnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/davit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientvit_mit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/rexnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/edgenext.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/swiftformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/nest.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/regnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/resnetv2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientvit_msra.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/shvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/tresnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/fastvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/fasternet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/levit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/vovnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/inception_v4.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/maxxvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/metaformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/repghost.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/swin_transformer_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/pvt_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/lcnetv2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/mambaout.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/gcvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/starnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/inception_next.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/focalnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/pit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/swin_transformer_v2_cr.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientformer_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/nextvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/hgnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/volo.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/xcit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/mvitv2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/twins.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/vision_transformer_sam.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/hiera.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/hieradet_sam2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/vision_transformer_relpos.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/cpubone.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/byobnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
142 more matches not shown…
Unused Imports782 hits · 536 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py53CODE
LOWtrain.py60CODE
LOWinference.py9CODE
LOWclean_checkpoint.py15CODE
LOWtests/test_scheduler.py18CODE
LOWtests/test_models.py30CODE
LOWtimm/__init__.py1CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/layers/squeeze_excite.py13CODE
LOWtimm/layers/classifier.py11CODE
LOWtimm/layers/create_act.py4CODE
LOWtimm/layers/create_act.py4CODE
LOWtimm/layers/create_act.py6CODE
LOWtimm/layers/create_act.py7CODE
LOWtimm/layers/create_norm.py9CODE
LOWtimm/layers/separable_conv.py8CODE
LOWtimm/layers/trace_utils.py2CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py11CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py19CODE
LOWtimm/layers/__init__.py19CODE
LOWtimm/layers/__init__.py19CODE
LOWtimm/layers/__init__.py20CODE
LOWtimm/layers/__init__.py20CODE
LOWtimm/layers/__init__.py21CODE
LOWtimm/layers/__init__.py21CODE
LOWtimm/layers/__init__.py22CODE
LOWtimm/layers/__init__.py22CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py24CODE
722 more matches not shown…
AI Structural Patterns453 hits · 452 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py1076CODE
LOWbenchmark.py208CODE
LOWtrain.py1250CODE
LOWtimm/layers/std_conv.py35CODE
LOWtimm/layers/std_conv.py76CODE
LOWtimm/layers/std_conv.py121CODE
LOWtimm/layers/std_conv.py182CODE
LOWtimm/layers/squeeze_excite.py30CODE
LOWtimm/layers/squeeze_excite.py109CODE
LOWtimm/layers/attention.py53CODE
LOWtimm/layers/attention.py158CODE
LOWtimm/layers/classifier.py249CODE
LOWtimm/layers/attention_pool2d.py36CODE
LOWtimm/layers/attention_pool2d.py195CODE
LOWtimm/layers/pos_embed_sincos.py168CODE
LOWtimm/layers/pos_embed_sincos.py86CODE
LOWtimm/layers/pos_embed_sincos.py337CODE
LOWtimm/layers/pos_embed_sincos.py404CODE
LOWtimm/layers/pos_embed_sincos.py542CODE
LOWtimm/layers/pos_embed_sincos.py1116CODE
LOWtimm/layers/separable_conv.py19CODE
LOWtimm/layers/separable_conv.py85CODE
LOWtimm/layers/gather_excite.py29CODE
LOWtimm/layers/non_local_attn.py153CODE
LOWtimm/layers/other_pool.py195CODE
LOWtimm/layers/other_pool.py286CODE
LOWtimm/layers/bottleneck_attn.py122CODE
LOWtimm/layers/bottleneck_attn.py185CODE
LOWtimm/layers/lambda_layer.py73CODE
LOWtimm/layers/lambda_layer.py171CODE
LOWtimm/layers/attention_pool.py20CODE
LOWtimm/layers/mlp.py19CODE
LOWtimm/layers/mlp.py63CODE
LOWtimm/layers/mlp.py120CODE
LOWtimm/layers/mlp.py171CODE
LOWtimm/layers/mlp.py218CODE
LOWtimm/layers/mlp.py256CODE
LOWtimm/layers/diff_attention.py37CODE
LOWtimm/layers/hybrid_embed.py28CODE
LOWtimm/layers/hybrid_embed.py228CODE
LOWtimm/layers/conv_bn_act.py16CODE
LOWtimm/layers/halo_attn.py142CODE
LOWtimm/layers/halo_attn.py247CODE
LOWtimm/layers/attention2d.py27CODE
LOWtimm/layers/attention2d.py107CODE
LOWtimm/layers/attention2d.py324CODE
LOWtimm/layers/patch_embed.py32CODE
LOWtimm/layers/patch_embed.py150CODE
LOWtimm/layers/eca.py61CODE
LOWtimm/layers/eca.py135CODE
LOWtimm/layers/global_context.py23CODE
LOWtimm/layers/split_attn.py38CODE
LOWtimm/layers/selective_kernel.py63CODE
LOWtimm/layers/cbam.py24CODE
LOWtimm/layers/cbam.py54CODE
LOWtimm/layers/cbam.py116CODE
LOWtimm/layers/cbam.py150CODE
LOWtimm/layers/cond_conv2d.py46CODE
LOWtimm/layers/cond_conv2d.py139CODE
LOWtimm/layers/norm_act.py64CODE
393 more matches not shown…
Hyper-Verbose Identifiers327 hits · 332 pts
SeverityFileLineSnippetContext
LOWtests/test_utils.py16def test_average_meter_zero_count():CODE
LOWtests/test_utils.py74def test_activation_stats_hook_validation():CODE
LOWtests/test_utils.py107def test_freeze_unfreeze_bn_root():CODE
LOWtests/test_utils.py124def test_activation_stats_functions():CODE
LOWtests/test_utils.py143def test_reparameterize_model():CODE
LOWtests/test_utils.py172def test_get_state_dict_custom_unwrap():CODE
LOWtests/test_utils.py190def test_freeze_unfreeze_string_input():CODE
LOWtests/test_task.py64def _param_group_weight_decay(optimizer):CODE
LOWtests/test_task.py72def test_task_checkpoint_omits_empty_task_state_and_keeps_legacy_paths(tmp_path):CODE
LOWtests/test_task.py103def test_feature_distillation_checkpoint_keeps_projection_in_task_state(tmp_path):CODE
LOWtests/test_task.py141def test_feature_distillation_trainable_module_optimizer_grouping():CODE
LOWtests/test_task.py167def test_base_eval_model_preserves_trainable_wrapper_for_use():CODE
LOWtests/test_task.py177def test_compiled_ema_eval_model_reflects_update():CODE
LOWtests/test_task.py202def test_compiled_eval_checkpoint_load_uses_unwrapped_state_dict_target():CODE
LOWtests/test_naflex_dataset.py42def test_naflex_epoch_batches_are_prepared_when_iteration_starts():CODE
LOWtests/test_naflex_dataset.py64def test_naflex_persistent_workers_read_shared_epoch():CODE
LOWtests/test_naflex_dataset.py88def test_naflex_persistent_workers_disable_mixup_at_configured_epoch():CODE
LOWtests/test_naflex_dataset.py117def test_naflex_epoch_prep_warnings_only_emitted_by_worker_zero(monkeypatch):CODE
LOWtests/test_hub.py27def test_load_state_dict_from_path_prefers_preferred_file(tmp_path):CODE
LOWtests/test_hub.py35def test_load_state_dict_from_path_ext_priority(tmp_path):CODE
LOWtests/test_hub.py45def test_load_state_dict_from_path_multiple_same_ext_warns(tmp_path, caplog):CODE
LOWtests/test_hub.py55def test_load_state_dict_from_path_accepts_str(tmp_path):CODE
LOWtests/test_hub.py60def test_load_state_dict_from_path_no_checkpoint(tmp_path):CODE
LOWtests/test_layers.py33def test_get_device_dtype_prefers_explicit_values():CODE
LOWtests/test_layers.py69def test_classifier_head_reset_preserves_dtype(head_cls, head_kwargs, input_shape, pool_type):CODE
LOWtests/test_layers.py93def test_attention_pool_head_reset_uses_parent_dtype(head_cls, head_kwargs):CODE
LOWtests/test_layers.py106def test_resample_abs_pos_embed_same_token_count_different_grid():CODE
LOWtests/test_layers.py130def test_patch_embed_interpolator_reuses_nonpersistent_cache(monkeypatch):CODE
LOWtests/test_layers.py162def test_patch_embed_interpolator_cache_survives_autocast(monkeypatch):CODE
LOWtests/test_layers.py190def test_patch_embed_interpolator_prewarm_supports_fullgraph_compile():CODE
LOWtests/test_layers.py216def test_patch_embed_interpolator_cache_keeps_per_device_entries_for_replicas(monkeypatch):CODE
LOWtests/test_layers.py227 def fake_compute_resize_matrix(old_size, new_size, interpolation, antialias, device, dtype):CODE
LOWtests/test_layers.py253def test_patch_embed_interpolator_prewarm_normalizes_device_alias(monkeypatch):CODE
LOWtests/test_layers.py265def test_patch_embed_interpolator_apply_accepts_recurse():CODE
LOWtests/test_layers.py342def test_get_act_layer_empty_string():CODE
LOWtests/test_layers.py347def test_create_act_layer_inplace_error():CODE
LOWtests/test_layers.py359def test_create_act_layer_edge_cases():CODE
LOWtests/test_factory.py58def test_parse_model_name_no_prefix(model_name):CODE
LOWtests/test_factory.py72def test_parse_model_name_invalid(model_name):CODE
LOWtests/test_optim.py29def _test_basic_cases_template(weight, bias, input, constructor, scheduler_constructors):CODE
LOWtests/test_optim.py289def _build_params_dict_single(weight, bias, **kwargs):CODE
LOWtests/test_optim.py392def test_compiled_foreach_adam_optimizers(optimizer_name, foreach):CODE
LOWtests/test_optim.py434def test_compiled_muon_fallback(nesterov):CODE
LOWtests/test_optim.py615def test_param_groups_layer_decay_with_min():CODE
LOWtests/test_optim.py638def test_registry_create_optimizer_layer_decay_default_min_scale():CODE
LOWtests/test_optim.py658def test_param_groups_layer_decay_with_matcher():CODE
LOWtests/test_optim.py685def test_param_groups_layer_decay_reg_token_stem(model_name):CODE
LOWtests/test_optim.py735def test_param_groups_weight_decay():CODE
LOWtests/test_optim.py787def test_adafactor_bv_factored_row_normalization(shape):CODE
LOWtests/test_optim.py809def test_sgdw_multi_tensor_weight_decay_matches_single_tensor():CODE
LOWtests/test_scheduler.py70 def test_plateau_scheduler_step(self):CODE
LOWtests/test_scheduler.py122 def test_warmup_prefix_reaches_target_lr(self, scheduler_cls, kwargs):CODE
LOWtests/test_scheduler.py347 def test_state_dict_save_load(self, scheduler_cls, kwargs):CODE
LOWtests/test_scheduler.py368 def test_plateau_state_dict_save_load(self):CODE
LOWtests/test_scheduler.py400 def test_step_update_with_t_in_epochs_false(self, scheduler_cls, kwargs):CODE
LOWtests/test_scheduler.py430 def test_multiple_param_groups(self, scheduler_cls, kwargs):CODE
LOWtests/test_models.py440 def test_model_load_pretrained(model_name, batch_size):CODE
LOWtests/test_models.py448 def test_model_features_pretrained(model_name, batch_size):CODE
LOWtests/test_models.py457def test_pruned_efficientnet_in_chans(model_name):CODE
LOWtests/test_models.py259def _assert_reset_classifier_preserves_parent_device_dtype(model):CODE
267 more matches not shown…
Modern Structural Boilerplate153 hits · 154 pts
SeverityFileLineSnippetContext
LOWtrain.py484def _set_loader_epoch(loader, epoch: int) -> None:CODE
LOWtimm/layers/attention.py12__all__ = ['Attention', 'AttentionRope', 'maybe_add_mask', 'resolve_self_attn_mask']CODE
LOWtimm/layers/config.py9__all__ = [CODE
LOWtimm/layers/_fx.py15__all__ = [CODE
LOWtimm/layers/typing.py7__all__ = ["LayerType", "PadType", "nullwrap", "disable_compiler"]CODE
LOWtimm/scheduler/scheduler.py91 def update_groups(self, values: Union[float, List[float]]) -> None:CODE
LOWtimm/optim/_types.py29__all__ = ['ParamsT', 'OptimType', 'OptimizerCallable']CODE
LOWtimm/optim/sgdw.py22__all__ = ['SGDW', 'sgdw']CODE
LOWtimm/optim/adopt.py26__all__ = ["Adopt", "adopt"]CODE
LOWtimm/models/repvit.py29__all__ = ['RepVit']CODE
LOWtimm/models/tiny_vit.py9__all__ = ['TinyVit']CODE
LOWtimm/models/deit.py25__all__ = ['VisionTransformerDistilled'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/ghostnet.py30__all__ = ['GhostNet']CODE
LOWtimm/models/volo.py36__all__ = ['VOLO'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/volo.py922 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/davit.py31__all__ = ['DaVit']CODE
LOWtimm/models/efficientvit_mit.py9__all__ = ['EfficientVit', 'EfficientVitLarge']CODE
LOWtimm/models/gemma4_vit.py29__all__ = ['Gemma4VitEncoder', 'Gemma4VitClassifier']CODE
LOWtimm/models/gemma4_vit.py787 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/gemma4_vit.py791 def set_clamp_enabled(self, enabled: bool = True) -> None:CODE
LOWtimm/models/gemma4_vit.py1120 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/gemma4_vit.py1124 def set_clamp_enabled(self, enabled: bool = True) -> None:CODE
LOWtimm/models/_efficientnet_blocks.py26__all__ = [CODE
LOWtimm/models/selecsls.py22__all__ = ['SelecSls'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/rexnet.py28__all__ = ['RexNet'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/rexnet.py335 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/inception_resnet_v2.py16__all__ = ['InceptionResnetV2']CODE
LOWtimm/models/edgenext.py37__all__ = ['EdgeNeXt'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/hrnet.py24__all__ = ['HighResolutionNet', 'HighResolutionNetFeatures'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/hieradet_sam2.py460 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/vgg.py20__all__ = ['VGG']CODE
LOWtimm/models/vgg.py195 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/byoanet.py22__all__ = []CODE
LOWtimm/models/convmixer.py15__all__ = ['ConvMixer']CODE
LOWtimm/models/swiftformer.py27__all__ = ['SwiftFormer']CODE
LOWtimm/models/nest.py50__all__ = ['Nest'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/cspnet.py28__all__ = ['CspNet'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/hardcorenas.py13__all__ = [] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/beit.py71__all__ = ['Beit']CODE
LOWtimm/models/vision_transformer_relpos.py40__all__ = ['VisionTransformerRelPos'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/xcit.py30__all__ = ['Xcit'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/regnet.py42__all__ = ['RegNet', 'RegNetCfg'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/regnet.py714 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/sequencer.py23__all__ = ['Sequencer2d'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/cpubone.py26__all__ = ['CPUBone']CODE
LOWtimm/models/mvitv2.py33__all__ = ['MultiScaleVit', 'MultiScaleVitCfg'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/resnetv2.py48__all__ = ['ResNetV2'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/resnetv2.py669 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/vision_transformer.py82__all__ = ['VisionTransformer'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/vision_transformer.py985 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/efficientvit_msra.py9__all__ = ['EfficientVitMsra']CODE
LOWtimm/models/xception_aligned.py21__all__ = ['XceptionAligned']CODE
LOWtimm/models/shvit.py27__all__ = ['SHViT']CODE
LOWtimm/models/tresnet.py21__all__ = ['TResNet'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/senet.py27__all__ = ['SENet']CODE
LOWtimm/models/fastvit.py33__all__ = ['FastVit']CODE
LOWtimm/models/_efficientnet_builder.py23__all__ = ["EfficientNetBuilder", "BlockArgs", "decode_arch_def", "efficientnet_init_weights",CODE
LOWtimm/models/fasternet.py32__all__ = ['FasterNet']CODE
LOWtimm/models/efficientformer.py37__all__ = ['EfficientFormer'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/twins.py30__all__ = ['Twins'] # model_registry will add each entrypoint fn to thisCODE
93 more matches not shown…
Deep Nesting151 hits · 149 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py428CODE
LOWlegacy_train.py1076CODE
LOWlegacy_train.py1288CODE
LOWbenchmark.py163CODE
LOWbenchmark.py564CODE
LOWbenchmark.py620CODE
LOWbenchmark.py305CODE
LOWvalidate.py175CODE
LOWvalidate.py462CODE
LOWvalidate.py491CODE
LOWtrain.py493CODE
LOWtrain.py1250CODE
LOWtrain.py1475CODE
LOWbulk_runner.py96CODE
LOWbulk_runner.py141CODE
LOWinference.py151CODE
LOWinference.py373CODE
LOWresults/generate_csv_results.py20CODE
LOWtimm/layers/classifier.py315CODE
LOWtimm/layers/pos_embed_sincos.py1315CODE
LOWtimm/layers/gather_excite.py29CODE
LOWtimm/layers/non_local_attn.py71CODE
LOWtimm/layers/adaptive_avgmax_pool.py42CODE
LOWtimm/layers/adaptive_avgmax_pool.py127CODE
LOWtimm/layers/inplace_abn.py43CODE
LOWtimm/layers/pool1d.py4CODE
LOWtimm/layers/create_attn.py22CODE
LOWtimm/layers/weight_init.py110CODE
LOWtimm/layers/norm_act.py278CODE
LOWtimm/layers/norm_act.py322CODE
LOWtimm/scheduler/scheduler_factory.py63CODE
LOWtimm/optim/_param_groups.py19CODE
LOWtimm/optim/sgdw.py195CODE
LOWtimm/optim/sgdw.py241CODE
LOWtimm/optim/_optim_factory.py177CODE
LOWtimm/optim/lamb.py153CODE
LOWtimm/optim/adafactor.py128CODE
LOWtimm/optim/adafactor_bv.py210CODE
LOWtimm/optim/adafactor_bv.py123CODE
LOWtimm/optim/lars.py76CODE
LOWtimm/optim/nvnovograd.py67CODE
LOWtimm/optim/adamp.py90CODE
LOWtimm/optim/adabelief.py107CODE
LOWtimm/optim/adamw.py103CODE
LOWtimm/optim/kron.py400CODE
LOWtimm/optim/kron.py218CODE
LOWtimm/optim/radam.py38CODE
LOWtimm/optim/laprop.py80CODE
LOWtimm/optim/muon.py531CODE
LOWtimm/optim/muon.py783CODE
LOWtimm/optim/rmsprop_tf.py100CODE
LOWtimm/optim/sgdp.py50CODE
LOWtimm/optim/madgrad.py91CODE
LOWtimm/utils/model.py111CODE
LOWtimm/utils/model.py233CODE
LOWtimm/utils/model.py237CODE
LOWtimm/models/davit.py470CODE
LOWtimm/models/inception_resnet_v2.py299CODE
LOWtimm/models/inception_resnet_v2.py303CODE
LOWtimm/models/hrnet.py439CODE
91 more matches not shown…
Docstring Block Structure12 hits · 60 pts
SeverityFileLineSnippetContext
HIGHtimm/optim/_optim_factory.py161Get the OptimInfo for an optimizer. Args: name: Name of the optimizer Returns: STRING
HIGHtimm/optim/_optim_factory.py182Get the optimizer class with any default arguments applied. This allows direct instantiation of optimizers withSTRING
HIGHtimm/optim/_optim_factory.py245Create an optimizer instance. Args: model_or_params: Model or parameters to optimize opSTRING
HIGHtimm/optim/_optim_factory.py1107List available optimizer names, optionally filtered. List all registered optimizers, with optional filtering using STRING
HIGHtimm/optim/_optim_factory.py1148Get the OptimInfo for an optimizer. Args: name: Name of the optimizer Returns: OptimInfo confiSTRING
HIGHtimm/optim/_optim_factory.py1166Get optimizer class by name with option to bind default arguments. Retrieves the optimizer class or a partial functSTRING
HIGHtimm/optim/_optim_factory.py1215Create an optimizer instance via timm registry. Creates and configures an optimizer with appropriate parameter grouSTRING
HIGHtimm/optim/muon.py267Check if a parameter is suitable for Muon optimization. Args: param: Parameter tensor min_dim_size:STRING
HIGHtimm/models/_efficientnet_builder.py82 Decode block definition string Gets a list of block arg (dicts) through a string notation of arguments. E.g. iSTRING
HIGHtimm/models/_factory.py27Parse source and name from potentially prefixed model name. Everything after a recognized source prefix is treated STRING
HIGHtimm/data/auto_augment.py587 Create a AutoAugment transform Args: config_str: String defining configuration of auto augmentation. ConsiSTRING
HIGHtimm/data/auto_augment.py768 Create a RandAugment transform Args: config_str (str): String defining configuration of random augmentatioSTRING
Decorative Section Separators15 hits · 45 pts
SeverityFileLineSnippetContext
MEDIUMtimm/optim/lion.py22# ==============================================================================COMMENT
MEDIUMtimm/models/beit.py29# --------------------------------------------------------COMMENT
MEDIUMtimm/models/twins.py8# --------------------------------------------------------COMMENT
MEDIUMtimm/models/twins.py13# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2.py9# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2.py14# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer.py12# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer.py17# --------------------------------------------------------COMMENT
MEDIUMtimm/models/focalnet.py14# --------------------------------------------------------COMMENT
MEDIUMtimm/models/focalnet.py19# --------------------------------------------------------COMMENT
MEDIUMtimm/models/hiera.py11# --------------------------------------------------------COMMENT
MEDIUMtimm/models/hiera.py24# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py24# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py29# --------------------------------------------------------COMMENT
MEDIUMtimm/data/tf_preprocessing.py23# ==============================================================================COMMENT
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippetContext
CRITICALtimm/models/hieradet_sam2.py427 self.head.fc.weight.data.mul_(head_init_scale)CODE
CRITICALtimm/models/hieradet_sam2.py428 self.head.fc.bias.data.mul_(head_init_scale)CODE
CRITICALtimm/models/hiera.py632 self.head.fc.weight.data.mul_(head_init_scale)CODE
CRITICALtimm/models/hiera.py633 self.head.fc.bias.data.mul_(head_init_scale)CODE
Over-Commented Block31 hits · 31 pts
SeverityFileLineSnippetContext
LOWtests/test_optim.py341 # _test_basic_cases(COMMENT
LOWtimm/layers/pos_embed_rel.py41COMMENT
LOWtimm/layers/patch_embed.py661 stride=patch_size, padding=0COMMENT
LOWtimm/layers/patch_embed.py681# img_size=240,COMMENT
LOWtimm/layers/patch_embed.py701# self.base_grid_size = tuple([i // p for i, p in zip(self.base_img_size, self.base_patch_size)])COMMENT
LOWtimm/layers/cond_conv2d.py121COMMENT
LOWtimm/optim/lion.py1""" Lion OptimizerCOMMENT
LOWtimm/optim/lamb.py21# Copyright (c) 2021, Habana Labs Ltd. All rights reserved.COMMENT
LOWtimm/optim/lamb.py41# Permission is hereby granted, free of charge, to any person obtaining a copyCOMMENT
LOWtimm/optim/adan.py1""" Adan OptimizerCOMMENT
LOWtimm/utils/distributed.py121 dist_backend = dist_backends.get(device_type, 'gloo')COMMENT
LOWtimm/models/volo.py1""" Vision OutLOoker (VOLO) implementationCOMMENT
LOWtimm/models/efficientvit_mit.py1181 # # hf_hub_id='timm/',COMMENT
LOWtimm/models/efficientvit_mit.py1281# def efficientvit_l1_sam(pretrained=False, **kwargs):COMMENT
LOWtimm/models/hieradet_sam2.py701# model_args = dict(window_spec=(8, 4, 16, 8))COMMENT
LOWtimm/models/beit.py21primaryClass={cs.CV}COMMENT
LOWtimm/models/efficientvit_msra.py661 x = self.forward_features(x)COMMENT
LOWtimm/models/efficientvit_msra.py681# k[-2] = 'linear'COMMENT
LOWtimm/models/shvit.py461 else:COMMENT
LOWtimm/models/shvit.py481 # downsample_mapping[f'^stages\\.{i}\\.blocks\\.1\\.'] = f'stages.{i}.downsample.2.'COMMENT
LOWtimm/models/fasternet.py401 # 'conv_head.weight': state_dict.pop('avgpool_pre_head.1.weight'),COMMENT
LOWtimm/models/twins.py101 x = x[:, :H, :W, :].contiguous()COMMENT
LOWtimm/models/twins.py121 # x = x.reshape(B, _h, self.ws, _w, self.ws, C).transpose(2, 3) # B, _h, _w, ws, ws, CCOMMENT
LOWtimm/models/levit.py921 # filter out attn biases, should not have been persistentCOMMENT
LOWtimm/models/visformer.py521 init_channels=32, embed_dim=384, depth=(7, 4, 4), num_heads=6, mlp_ratio=4., group=8,COMMENT
LOWtimm/models/visformer.py541# spatial_conv='000', vit_stem=False, conv_init=True, **kwargs)COMMENT
LOWtimm/models/visformer.py561# return modelCOMMENT
LOWtimm/models/visformer.py581#COMMENT
LOWtimm/models/hiera.py1""" An PyTorch implementation of HieraCOMMENT
LOWtimm/data/tf_preprocessing.py1""" Tensorflow Preprocessing AdapterCOMMENT
LOW.github/workflows/trufflehog.yml21 # unreachable), so we still fail on maybe-real secrets; 'unverified' (the noisyCOMMENT
Excessive Try-Catch Wrapping23 hits · 28 pts
SeverityFileLineSnippetContext
MEDIUMavg_checkpoints.py85 print("Error: Output filename ({}) already exists.".format(output))CODE
MEDIUMavg_checkpoints.py113 print('Error: No checkpoints found to average.')CODE
MEDIUMavg_checkpoints.py121 print(f"Error: Checkpoint ({c}) doesn't exist")CODE
LOWbulk_runner.py203 except Exception as e:CODE
MEDIUMclean_checkpoint.py42 print("Error: Output filename ({}) already exists.".format(args.output))CODE
MEDIUMclean_checkpoint.py110 print("Error: Checkpoint ({}) doesn't exist".format(checkpoint))CODE
LOWtests/test_models.py199 except Exception:CODE
LOWtests/test_models.py600 except Exception:CODE
LOWtimm/layers/blur_pool.py118 except Exception:CODE
LOWtimm/optim/lion.py159 except Exception:STRING
LOWtimm/optim/adan.py127 except Exception:CODE
MEDIUMtimm/optim/adan.py34def __init__(self, chunk_size):CODE
LOWtimm/optim/adamw.py216 except Exception:STRING
LOWtimm/optim/nadamw.py197 except Exception:STRING
LOWtimm/utils/jit.py33 except Exception:CODE
LOWtimm/utils/jit.py42 except Exception:CODE
LOWtimm/utils/checkpoint_saver.py122 except Exception as e:CODE
LOWtimm/utils/checkpoint_saver.py178 except Exception as e:CODE
LOWtimm/models/eva.py1250 except Exception as e:CODE
LOWtimm/models/_hub.py588 except Exception as _:CODE
LOWtimm/models/_helpers.py36 except Exception:CODE
LOWtimm/data/naflex_dataset.py553 except Exception as e:CODE
LOWtimm/data/readers/reader_wds.py57 except Exception as e:CODE
Redundant / Tautological Comments16 hits · 24 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py689 # Check if we should use the NaFlex scheduled loaderCOMMENT
LOWlegacy_train.py753 # Check if we have model's patch size for NaFlex modeCOMMENT
LOWtrain.py694 # Check if we should use the NaFlex scheduled loaderCOMMENT
LOWtrain.py773 # Check if we have model's patch size for NaFlex modeCOMMENT
LOWtimm/layers/pos_embed_sincos.py682 # Check if we have pre-computed bandsCOMMENT
LOWtimm/layers/blur_pool.py143 # Check if aa_layer is a partial and already has device/dtype setCOMMENT
LOWtimm/optim/muon.py576 # Increment stepCOMMENT
LOWtimm/models/vision_transformer.py3197 # Check if we should use NaFlexVit insteadCOMMENT
LOWtimm/models/fastvit.py97 # Check if SE-ReLU is requestedCOMMENT
LOWtimm/models/naflexvit.py298 # Check if we need EVA block featuresCOMMENT
LOWtimm/models/naflexvit.py2019 # Check if it's a perfect square for a standard gridCOMMENT
LOWtimm/models/eva.py1319 # Check if we should use NaFlexVit implementationCOMMENT
LOWtimm/models/_hub.py435 # Check if README file already exist in repoCOMMENT
LOWtimm/models/_helpers.py150 # Check if safetensors or not and load weights accordinglyCOMMENT
LOWtimm/data/naflex_dataset.py120 # Check if patches are flattened or unflattenedCOMMENT
LOWconvert/convert_gemma4_vit.py97 # Check if this is a vision key (vision_tower or vision_model)COMMENT
Self-Referential Comments10 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtimm/models/_factory.py122 >>> # Create a MobileNetV3-Large model with no pretrained weights.STRING
MEDIUMtimm/models/_factory.py125 >>> # Create a MobileNetV3-Large model with pretrained weights.STRING
MEDIUMtimm/models/_factory.py130 >>> # Create a MobileNetV3-Large model with pretrained weights and a new head with 10 classes.STRING
MEDIUMtimm/models/_factory.py135 >>> # Create a Dinov2 small model with pretrained weights and save weights in a custom directory.STRING
MEDIUMtimm/models/naflexvit.py1057 # Create the float mask and apply masking using additive mask conventionCOMMENT
MEDIUMtimm/models/hiera.py155 # Create a view of the tensor with the patch stride as separate dimsCOMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py98 r"""This class implements window-based Multi-Head-Attention with log-spaced continuous position bias.CODE
MEDIUMtimm/models/swin_transformer_v2_cr.py246 r"""This class implements the Swin transformer block.CODE
MEDIUMtimm/models/swin_transformer_v2_cr.py594 r"""This class implements a stage of the Swin transformer including multiple layers.CODE
MEDIUMtimm/data/naflex_loader.py427 # Create the collatorCOMMENT
AI Slop Vocabulary5 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMtimm/layers/norm_act.py156 # but ONLY when used in conjunction with the timm conversion function below.STRING
MEDIUMtimm/models/gemma4_vit.py1378 # so the test harness' size-clamp doesn't land at 128 and blow theCOMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py681 """ Updates the resolution to utilize and the window size and so the pair-wise relative positions.STRING
MEDIUMtimm/data/imagenet_info.py41 # which will be more robust than a guess based on num_classesCOMMENT
LOWtimm/data/naflex_dataset.py62 # If no divisor specified, just use integer divisionCOMMENT
Cross-Language Confusion1 hit · 2 pts
SeverityFileLineSnippetContext
HIGHtimm/models/naflexvit.py1657 spatial reshape is undefined); with ``output_dict=True`` the result also carries 'patch_valid'STRING
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtimm/models/xception.py289 # The resize parameter of the validation transform should be 333, and make sure to center crop at 299x299COMMENT
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtimm/data/naflex_transforms.py261 # Step 1: Get the maximum allowed dimensions from sequence length constraintCOMMENT
Structural Annotation Overuse1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtimm/data/naflex_transforms.py261 # Step 1: Get the maximum allowed dimensions from sequence length constraintCOMMENT