AI Slop Code RIsk Monitor

keras-team/keras

Deep Learning for humans

26.2 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for keras-team/keras, a Python project with 64,363 GitHub stars. SynthScan examined 322,905 lines of code across 1029 source files, recording 7741 pattern matches distributed across 21 syntactic categories. The legacy adjusted pattern signal is 26.2 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

26.2
Adjusted Signal
26.2
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
64.4K
Stars
Python
Language
322.9K
Lines of Code
1.0K
Files
7.7K
Pattern Hits
2026-10-12
Scan Date
0.41
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 48.7/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 3719 finding(s).

Hallucinated Dependency & Supply Chain Risk 33.0/100 · MEDIUM

Are imports declared and package/API names verified? 3665 finding(s).

Agent Over-Engineering Ratio 51.3/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 3469 finding(s).

PR Review Velocity Impact 79.0/100 · CRITICAL

Which changes need focused human review? 7741 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 417MEDIUM 120LOW 7204

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 7741 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers2921 hits · 2898 pts
SeverityFileLineSnippetContext
LOWconftest.py50def pytest_collection_modifyitems(config, items):CODE
LOWpip_build.py73def copy_source_to_build_directory(root_path):CODE
LOWapi_gen.py23def copy_source_to_build_directory(root_path):CODE
LOWkeras/src/api_export.py13def register_internal_serializable(path, symbol):CODE
LOWkeras/src/activations/activations_test.py106 def test_softmax_higher_dim_multiple_axes(self):CODE
LOWkeras/src/activations/activations_test.py115 def test_softmax_negative_axis(self):CODE
LOW⚡keras/src/activations/activations_test.py151 def test_log_softmax_higher_dim(self):CODE
LOW⚡keras/src/activations/activations_test.py160 def test_log_softmax_higher_dim_multiple_axes(self):CODE
LOW⚡keras/src/activations/activations_test.py169 def test_log_softmax_negative_axis(self):CODE
LOW⚡keras/src/activations/activations_test.py177 def test_temporal_log_softmax(self):CODE
LOW⚡keras/src/activations/activations_test.py488 def test_relu_combined_threshold_and_max_value(self):CODE
LOW⚡keras/src/activations/activations_test.py497 def test_relu_combined_all_parameters(self):CODE
LOWkeras/src/activations/activations_test.py514 def test_relu_to_trigger_leaky(self):CODE
LOWkeras/src/visualization/plot_bounding_box_gallery.py18def plot_bounding_box_gallery(CODE
LOW…as/src/visualization/plot_segmentation_mask_gallery.py15def plot_segmentation_mask_gallery(CODE
LOWkeras/src/tree/dmtree_impl.py162def _recursive_flatten_with_path(path, structure, flattened):CODE
LOWkeras/src/tree/torchtree_impl.py32def _dict_to_ordered_dict_with_changed(structure):CODE
LOWkeras/src/tree/torchtree_impl.py175 def func_with_check_without_shallow_structure(shallow, *args):CODE
LOWkeras/src/tree/tree_test.py163 def test_is_nested_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py430 def test_flatten_with_path_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py587 def test_nested_dict_key_order(self, t):CODE
LOWkeras/src/tree/tree_test.py610 def test_pack_sequence_as_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py636 def test_map_structure_with_one_structure(self, t):CODE
LOWkeras/src/tree/tree_test.py770 def test_map_structure_with_one_structure_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py799 def test_map_structure_with_multiple_structures(self, t):CODE
LOWkeras/src/tree/tree_test.py1127 def test_map_structure_with_multiple_structures_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py1209 def test_assert_same_structure(self, t):CODE
LOWkeras/src/tree/tree_test.py1564 def test_assert_same_structure_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py1801 def test_assert_same_paths_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py2086 def test_traverse_top_down_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py2410 def test_traverse_bottom_up_tf_wrappers(self, t):CODE
LOWkeras/src/tree/tree_test.py2533 def test_traverse_torch_compile_fullgraph(self, t):CODE
LOWkeras/src/tree/optree_impl.py122 def func_with_check_without_shallow_structure(shallow, *args):CODE
LOW⚡keras/src/metrics/confusion_metrics_test.py727 def test_unweighted_all_correct(self):CODE
LOW⚡keras/src/metrics/confusion_metrics_test.py734 def test_unweighted_high_specificity(self):CODE
LOW⚡keras/src/metrics/confusion_metrics_test.py744 def test_unweighted_low_specificity(self):CODE
LOW⚡keras/src/metrics/confusion_metrics_test.py829 def test_unweighted_all_correct(self):CODE
LOW⚡keras/src/metrics/confusion_metrics_test.py837 def test_unweighted_high_sensitivity(self):CODE
LOW⚡keras/src/metrics/confusion_metrics_test.py847 def test_unweighted_low_sensitivity(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py54 def test_unweighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py72 def test_weighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py148 def test_unweighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py166 def test_weighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py237 def test_unweighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py255 def test_weighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py326 def test_unweighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py344 def test_weighted_with_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py407 def test_unweighted_all_incorrect(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py436 def test_unweighted_with_threshold(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py443 def test_weighted_with_threshold(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py504 def test_unweighted_class_id_multiclass(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py532 def test_unweighted_top_k_and_threshold(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py572 def test_unweighted_all_incorrect(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py599 def test_unweighted_with_threshold(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py605 def test_weighted_with_threshold(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py665 def test_unweighted_class_id_multiclass(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py693 def test_unweighted_top_k_and_threshold(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py784 def test_invalid_num_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py887 def test_invalid_num_thresholds(self):CODE
LOWkeras/src/metrics/confusion_metrics_test.py913 def test_unweighted_all_correct(self):CODE
2861 more matches not shown…
Unused Imports3660 hits · 2577 pts
SeverityFileLineSnippetContext
LOWpip_build.py29CODE
LOWkeras/__init__.py9CODE
LOWkeras/__init__.py10CODE
LOWkeras/api/__init__.py7CODE
LOWkeras/api/__init__.py8CODE
LOWkeras/api/__init__.py9CODE
LOWkeras/api/__init__.py10CODE
LOWkeras/api/__init__.py11CODE
LOWkeras/api/__init__.py12CODE
LOWkeras/api/__init__.py13CODE
LOWkeras/api/__init__.py14CODE
LOWkeras/api/__init__.py15CODE
LOWkeras/api/__init__.py16CODE
LOWkeras/api/__init__.py17CODE
LOWkeras/api/__init__.py18CODE
LOWkeras/api/__init__.py19CODE
LOWkeras/api/__init__.py20CODE
LOWkeras/api/__init__.py21CODE
LOWkeras/api/__init__.py22CODE
LOWkeras/api/__init__.py23CODE
LOWkeras/api/__init__.py24CODE
LOWkeras/api/__init__.py25CODE
LOWkeras/api/__init__.py26CODE
LOWkeras/api/__init__.py27CODE
LOWkeras/api/__init__.py28CODE
LOWkeras/api/__init__.py29CODE
LOWkeras/api/__init__.py30CODE
LOWkeras/api/__init__.py31CODE
LOWkeras/api/__init__.py32CODE
LOWkeras/api/__init__.py33CODE
LOWkeras/api/__init__.py34CODE
LOWkeras/api/__init__.py35CODE
LOWkeras/api/__init__.py36CODE
LOWkeras/api/__init__.py37CODE
LOWkeras/api/__init__.py38CODE
LOWkeras/api/__init__.py39CODE
LOWkeras/api/__init__.py40CODE
LOWkeras/api/__init__.py41CODE
LOWkeras/api/__init__.py42CODE
LOWkeras/api/__init__.py43CODE
LOWkeras/api/__init__.py46CODE
LOWkeras/api/__init__.py49CODE
LOWkeras/api/__init__.py50CODE
LOWkeras/api/__init__.py53CODE
LOWkeras/api/__init__.py54CODE
LOWkeras/api/__init__.py55CODE
LOWkeras/api/__init__.py56CODE
LOWkeras/api/__init__.py57CODE
LOWkeras/api/__init__.py58CODE
LOWkeras/api/__init__.py59CODE
LOWkeras/api/__init__.py60CODE
LOWkeras/api/__init__.py61CODE
LOWkeras/api/__init__.py62CODE
LOWkeras/api/__init__.py63CODE
LOWkeras/api/__init__.py64CODE
LOWkeras/api/__init__.py65CODE
LOWkeras/api/__init__.py66CODE
LOWkeras/api/__init__.py67CODE
LOWkeras/api/activations/__init__.py7CODE
LOWkeras/api/activations/__init__.py8CODE
3600 more matches not shown…
Cross-File Repetition244 hits · 1220 pts
SeverityFileLineSnippetContext
HIGHkeras/api/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/activations/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/visualization/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/tree/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/metrics/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/losses/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/wrappers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/layers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/constraints/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/config/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/callbacks/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/quantizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/boston_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/fashion_mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/reuters/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/cifar100/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/imdb/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/california_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/datasets/cifar10/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/distribution/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/distillation/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/mixed_precision/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/legacy/saving/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/utils/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/utils/bounding_boxes/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/utils/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/backend/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/models/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/optimizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/optimizers/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/optimizers/schedules/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/regularizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/activations/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/visualization/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/tree/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/metrics/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/losses/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/wrappers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/layers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/constraints/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/config/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/callbacks/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/quantizers/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/datasets/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/datasets/mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGH…pi/_tf_keras/keras/datasets/boston_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGH…api/_tf_keras/keras/datasets/fashion_mnist/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/datasets/reuters/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/datasets/cifar100/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/datasets/imdb/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGH…tf_keras/keras/datasets/california_housing/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/datasets/cifar10/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/distribution/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/distillation/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/mixed_precision/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
HIGHkeras/api/_tf_keras/keras/legacy/__init__.py0do not edit. this file was autogenerated. do not edit it by hand, since your modifications would be overwritten.STRING
184 more matches not shown…
Docstring Block Structure128 hits · 580 pts
SeverityFileLineSnippetContext
HIGHkeras/src/activations/activations.py8Applies the rectified linear unit activation function. With default values, this returns the standard ReLU activatiSTRING
HIGHkeras/src/visualization/plot_bounding_box_gallery.py39Plots a gallery of images with bounding boxes. This function can display both ground truth and predicted bounding bSTRING
HIGHkeras/src/visualization/draw_bounding_boxes.py28Draws bounding boxes on images. This function draws bounding boxes on a batch of images. It supports differentSTRING
HIGHkeras/src/visualization/draw_segmentation_masks.py19Draws segmentation masks on images. The function overlays segmentation masks on the input images. The masks areSTRING
HIGH…as/src/visualization/plot_segmentation_mask_gallery.py28Plots a gallery of images with corresponding segmentation masks. Args: images: A 4D tensor or NumPy array oSTRING
HIGHkeras/src/visualization/plot_image_gallery.py19Extracts a batch of images for plotting. Args: images: The 4D tensor or NumPy array of images. num_STRING
HIGHkeras/src/tree/tree_api.py36Checks if a given structure is nested. Examples: >>> keras.tree.is_nested(42) False >>> keras.tree.is_STRING
HIGHkeras/src/tree/tree_api.py57Traverses the given nested structure, applying the given function. The traversal is depth-first. If `top_down` is TSTRING
HIGHkeras/src/tree/tree_api.py110Flattens a possibly nested structure into a list. In the case of dict instances, the sequence consists of the valueSTRING
HIGHkeras/src/tree/tree_api.py151Flattens a possibly nested structure into a list. This is a variant of flattens() which produces a list of pairSTRING
HIGHkeras/src/tree/tree_api.py177Maps `func` through given structures. Examples: >>> structure = [[1], [2], [3]] >>> keras.tree.map_structuSTRING
HIGHkeras/src/tree/tree_api.py217Maps `func` through given structures up to `shallow_structure`. This is a variant of `map_structure` which only mapSTRING
HIGHkeras/src/tree/tree_api.py254Asserts that two structures are nested in the same way. This function verifies that the nested structures match. ThSTRING
HIGHkeras/src/tree/tree_api.py310Asserts that two structures have identical paths in their tree structure. This function verifies that two nested stSTRING
HIGHkeras/src/tree/tree_api.py339Returns a given flattened sequence packed into a given structure. If `structure` is an atom, `flat_sequence` must bSTRING
HIGHkeras/src/losses/losses.py2697Computes the sparse categorical crossentropy loss. Args: y_true: Ground truth values. y_pred: The pSTRING
HIGHkeras/src/layers/layer.py78This is the class from which all layers inherit. A layer is a callable object that takes as input one or more tensoSTRING
HIGHkeras/src/layers/core/einsum_dense.py646Parses an einsum string to determine the shapes of the weights. This function is the main entry point for analyzingSTRING
HIGHkeras/src/layers/core/einsum_dense.py713Computes kernel and bias shapes from a parsed einsum equation. This function takes the components of an einsum equaSTRING
HIGHkeras/src/layers/convolutional/depthwise_conv2d.py72D depthwise convolution layer. Depthwise convolution is a type of convolution in which each input channel is cSTRING
HIGHkeras/src/layers/convolutional/depthwise_conv1d.py71D depthwise convolution layer. Depthwise convolution is a type of convolution in which each input channel is cSTRING
HIGHkeras/src/layers/convolutional/conv3d_transpose.py123D transposed convolution layer. The need for transposed convolutions generally arise from the desire to use a STRING
HIGHkeras/src/layers/convolutional/conv1d.py81D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved with thSTRING
HIGHkeras/src/layers/convolutional/conv2d_transpose.py122D transposed convolution layer. The need for transposed convolutions generally arise from the desire to use a STRING
HIGHkeras/src/layers/convolutional/conv3d.py73D convolution layer. This layer creates a convolution kernel that is convolved with the layer input over a 3D STRING
HIGHkeras/src/layers/convolutional/conv2d.py72D convolution layer. This layer creates a convolution kernel that is convolved with the layer input over a 2D STRING
HIGHkeras/src/layers/convolutional/conv1d_transpose.py121D transposed convolution layer. The need for transposed convolutions generally arise from the desire to use a STRING
HIGHkeras/src/layers/preprocessing/stft_spectrogram.py14Layer to compute the Short-Time Fourier Transform (STFT) on a 1D signal. A layer that computes Spectrograms of the STRING
HIGH…ssing/image_preprocessing/bounding_boxes/converters.py14Converts bounding boxes between formats. Supported formats (case-insensitive): `"xyxy"`: [left, top, right, botSTRING
HIGH…ssing/image_preprocessing/bounding_boxes/converters.py265Encodes bounding boxes relative to anchors as deltas. This function calculates the deltas that represent the differSTRING
HIGH…ssing/image_preprocessing/bounding_boxes/converters.py357Converts bounding boxes from delta format to the specified `box_format`. This function decodes bounding box deltas STRING
HIGHkeras/src/layers/merging/concatenate.py10Concatenates a list of inputs. It takes as input a list of tensors, all of the same shape except for the concatSTRING
HIGHkeras/src/layers/merging/add.py42Functional interface to the `keras.layers.Add` layer. Args: inputs: A list of input tensors with the same sSTRING
HIGHkeras/src/layers/merging/subtract.py53Functional interface to the `keras.layers.Subtract` layer. Args: inputs: A list of input tensors of size 2,STRING
HIGHkeras/src/layers/merging/multiply.py63Functional interface to the `keras.layers.Multiply` layer. Args: inputs: A list of input tensors , all of tSTRING
HIGHkeras/src/layers/merging/maximum.py39Functional interface to the `keras.layers.Maximum` layer. Args: inputs: A list of input tensors , all of thSTRING
HIGHkeras/src/layers/merging/minimum.py39Functional interface to the `keras.layers.Minimum` layer. Args: inputs: A list of input tensors , all of thSTRING
HIGHkeras/src/layers/merging/average.py42Functional interface to the `keras.layers.Average` layer. Args: inputs: A list of input tensors , all of thSTRING
HIGHkeras/src/layers/merging/base_merge.py61Computes the shape of the resultant of an elementwise operation. Args: shape1: Tuple or None. ShapeSTRING
HIGHkeras/src/callbacks/tensorboard_test.py65Read all summaries under the logdir into a `_SummaryFile`. Args: logdir: A path to a directory that contains STRING
HIGHkeras/src/callbacks/tensorboard.py660Writes a Keras model as JSON to as a Summary. Writing the Keras model configuration allows the TensorBoard graph plSTRING
HIGHkeras/src/distillation/distiller.py12Distillation model for transferring knowledge from teacher to student. Knowledge distillation transfers knowledge fSTRING
HIGHkeras/src/legacy/preprocessing/image.py1385Applies a transformation to an image according to given parameters. Args: x: 3D tensor, single imagSTRING
HIGHkeras/src/legacy/preprocessing/image.py1705Performs a brightness shift. DEPRECATED. Args: x: Input tensor. Must be 3D. brightness: Float.STRING
HIGHkeras/src/legacy/preprocessing/image.py1736Performs a random brightness shift. DEPRECATED. Args: x: Input tensor. Must be 3D. brightness_STRING
HIGHkeras/src/legacy/saving/saving_utils.py24Instantiates a Keras model from its config. Args: config: Configuration dictionary. custom_objects:STRING
HIGHkeras/src/legacy/saving/json_utils.py134Serializes any object to a JSON-serializable structure. Args: obj: the object to serialize Returns: STRING
HIGHkeras/src/legacy/saving/legacy_h5_format.py81Loads a model saved via `save_model_to_hdf5`. Args: filepath: One of the following: - String, pSTRING
HIGHkeras/src/legacy/saving/legacy_h5_format.py579Load layer weights of a model from hdf5. Args: group: HDF5 group. Returns: List of NumPy arraySTRING
HIGHkeras/src/backend/config.py54Set the default float dtype. Note: It is not recommended to set this to `"float16"` for training, as this will STRING
HIGHkeras/src/backend/common/variables.py16Represents a backend-agnostic variable in Keras. A `Variable` acts as a container for state. It holds a tensor valuSTRING
HIGHkeras/src/backend/common/dtypes.py286Returns the type from applying the Keras type promotion rules. In general, each argument is first parsed by `backenSTRING
HIGHkeras/src/backend/jax/ops/nn.py1596Applies a wrapped flash attention mechanism using the Splash kernel. This function prepares the appropriate attentioSTRING
HIGHkeras/src/optimizers/multi_optimizer.py37Retrieves the corresponding `Optimizer` by the string key. This method first attempts an exact key match. If noSTRING
HIGH…ras/src/optimizers/schedules/learning_rate_schedule.py191A `LearningRateSchedule` that uses a piecewise constant decay schedule. The function returns a 1-arg callable to coSTRING
HIGHkeras/src/dtype_policies/dtype_policy_map.py126Retrieves the corresponding `DTypePolicy` by the string key. This method first attempts an exact key match. If STRING
HIGHkeras/src/applications/imagenet_utils.py19 Preprocesses a tensor or Numpy array encoding a batch of images. Usage example with `applications.MobileNet`: `STRING
HIGHkeras/src/applications/imagenet_utils.py118Decodes the prediction of an ImageNet model. Args: preds: NumPy array encoding a batch of predictions. STRING
HIGHkeras/src/applications/imagenet_utils.py304Internal utility to compute/validate a model's input shape. Args: input_shape: Either None (will return the dSTRING
HIGHkeras/src/applications/convnext.py223ConvNeXt block. References: - https://arxiv.org/abs/2201.03545 - https://github.com/facebookresearch/ConvNeSTRING
68 more matches not shown…
Deep Nesting284 hits · 270 pts
SeverityFileLineSnippetContext
LOWconftest.py19CODE
LOWapi_gen.py36CODE
LOWkeras/src/visualization/draw_bounding_boxes.py17CODE
LOWkeras/src/tree/dmtree_impl.py162CODE
LOWkeras/src/tree/dmtree_impl.py244CODE
LOWkeras/src/tree/torchtree_impl.py119CODE
LOWkeras/src/losses/loss.py56CODE
LOWkeras/src/losses/losses.py1309CODE
LOWkeras/src/layers/input_spec.py122CODE
LOWkeras/src/layers/layer.py902CODE
LOWkeras/src/layers/layer.py1130CODE
LOWkeras/src/layers/layer.py2089CODE
LOWkeras/src/layers/activations/softmax.py55CODE
LOW…s/src/layers/attention/grouped_query_attention_test.py106CODE
LOWkeras/src/layers/attention/multi_head_attention_test.py113CODE
LOWkeras/src/layers/reshaping/cropping3d.py125CODE
LOWkeras/src/layers/reshaping/cropping2d.py145CODE
LOWkeras/src/layers/core/embedding.py261CODE
LOWkeras/src/layers/core/embedding.py308CODE
LOWkeras/src/layers/core/dense.py254CODE
LOWkeras/src/layers/core/dense.py316CODE
LOWkeras/src/layers/core/embedding_test.py722CODE
LOWkeras/src/layers/core/dense_test.py1196CODE
LOWkeras/src/layers/core/einsum_dense.py337CODE
LOWkeras/src/layers/core/einsum_dense.py399CODE
LOWkeras/src/layers/core/einsum_dense_test.py1415CODE
LOWkeras/src/layers/convolutional/conv_transpose_test.py178CODE
LOWkeras/src/layers/preprocessing/index_lookup.py653CODE
LOWkeras/src/layers/preprocessing/index_lookup.py866CODE
LOWkeras/src/layers/preprocessing/hashed_crossing.py138CODE
LOWkeras/src/layers/preprocessing/discretization.py167CODE
LOWkeras/src/layers/preprocessing/text_vectorization.py401CODE
LOWkeras/src/layers/preprocessing/text_vectorization.py585CODE
LOWkeras/src/layers/preprocessing/stft_spectrogram.py290CODE
LOWkeras/src/layers/preprocessing/normalization.py252CODE
LOWkeras/src/layers/preprocessing/feature_space.py387CODE
LOWkeras/src/layers/preprocessing/feature_space.py463CODE
LOWkeras/src/layers/preprocessing/feature_space.py494CODE
LOWkeras/src/layers/preprocessing/feature_space.py628CODE
LOWkeras/src/layers/preprocessing/feature_space.py760CODE
LOW…ayers/preprocessing/image_preprocessing/center_crop.py191CODE
LOW…ssing/image_preprocessing/bounding_boxes/validation.py24CODE
LOW…ssing/image_preprocessing/bounding_boxes/validation.py124CODE
LOWkeras/src/layers/merging/base_merge.py60CODE
LOWkeras/src/layers/merging/base_merge.py143CODE
LOWkeras/src/layers/rnn/bidirectional.py199CODE
LOWkeras/src/layers/rnn/bidirectional.py309CODE
LOWkeras/src/layers/rnn/bidirectional.py415CODE
LOWkeras/src/layers/rnn/lstm.py529CODE
LOWkeras/src/layers/rnn/gru.py547CODE
LOWkeras/src/callbacks/callback_list.py59CODE
LOWkeras/src/callbacks/swap_ema_weights.py116CODE
LOWkeras/src/callbacks/reduce_lr_on_plateau.py99CODE
LOWkeras/src/callbacks/orbax_checkpoint.py301CODE
LOWkeras/src/callbacks/model_checkpoint.py255CODE
LOWkeras/src/callbacks/model_checkpoint.py388CODE
LOWkeras/src/callbacks/monitor_callback.py62CODE
LOWkeras/src/callbacks/tensorboard_test.py64CODE
LOWkeras/src/callbacks/tensorboard_test.py663CODE
LOWkeras/src/callbacks/tensorboard.py156CODE
224 more matches not shown…
Self-Referential Comments85 hits · 227 pts
SeverityFileLineSnippetContext
MEDIUMkeras/src/activations/activations_test.py460 # Define the input tensorCOMMENT
MEDIUM⚡keras/src/activations/activations_test.py471 # Define the input tensorCOMMENT
MEDIUM⚡keras/src/activations/activations_test.py480 # Define the input tensorCOMMENT
MEDIUM⚡keras/src/activations/activations_test.py489 # Define the input tensorCOMMENT
MEDIUM⚡keras/src/activations/activations_test.py498 # Define the input tensorCOMMENT
MEDIUMkeras/src/layers/layer.py166 # Create the state of the layer (weights)STRING
MEDIUMkeras/src/layers/layer.py206 # Create a non-trainable weight.STRING
MEDIUMkeras/src/layers/layer_test.py188 # Create a mock to track calls to rematCOMMENT
MEDIUMkeras/src/layers/layer_test.py1098 # Create an input tensor WITHOUT an attached mask.COMMENT
MEDIUMkeras/src/layers/layer_test.py1102 # Create a mask to be passed explicitly.COMMENT
MEDIUMkeras/src/layers/preprocessing/text_vectorization.py180 >>> # Create the layer.STRING
MEDIUMkeras/src/layers/preprocessing/text_vectorization.py202 >>> # Create the layer, passing the vocab directly. You can also pass theSTRING
MEDIUMkeras/src/layers/preprocessing/discretization_test.py407 # Create a KerasTensor inputCOMMENT
MEDIUM…/src/layers/preprocessing/image_preprocessing/clahe.py58 # Create a CLAHE layer with default parametersSTRING
MEDIUM…yers/preprocessing/image_preprocessing/equalization.py48 # Create an equalization layer for standard 8-bit imagesSTRING
MEDIUMkeras/src/callbacks/orbax_checkpoint_test.py220 # Create a new model with the same architectureCOMMENT
MEDIUMkeras/src/callbacks/orbax_checkpoint.py171 # Create the V1 Checkpointer with direct parameter passingCOMMENT
MEDIUMkeras/src/callbacks/model_checkpoint.py37 # Define a learning rate scheduleSTRING
MEDIUMkeras/src/callbacks/model_checkpoint.py97 # Define a learning rate scheduleSTRING
MEDIUMkeras/src/quantizers/quantizers_test.py199 # Create a random tensor with int4 values in the specified range andCOMMENT
MEDIUMkeras/src/quantizers/awq.py462 # Create a temporary object that holds a reshaped 2D versionCOMMENT
MEDIUMkeras/src/quantizers/gptq.py335 # Create a temporary object that holds a reshapedCOMMENT
MEDIUMkeras/src/distribution/distribution_lib.py553 # Create a mesh with 2 devices for data parallelism and 4 devices forSTRING
MEDIUMkeras/src/distribution/distribution_lib.py557 # Create a layout map that shard the `Dense` layer and `Conv2D`STRING
MEDIUMkeras/src/distillation/distiller_test.py130 # Create a new teacher that is trainable and verify it gets frozenCOMMENT
MEDIUMkeras/src/utils/config.py26 # Create a config via constructor argumentsSTRING
MEDIUMkeras/src/utils/file_utils_test.py136 # Creating a TarInfo-like object with a name attributeCOMMENT
MEDIUMkeras/src/utils/summary_utils.py351 # Create a rich console for printing. Capture for non-interactive logging.COMMENT
MEDIUM…backend/torch/torch_multi_process_distribution_test.py163 # Create a dataset with range, so that we can verify the numericalCOMMENT
MEDIUMkeras/src/backend/torch/trainer.py322 # Create the validation data using the training data. Only supportedCOMMENT
MEDIUMkeras/src/backend/torch/trainer.py339 # Create an iterator that yields batches for one epoch.COMMENT
MEDIUMkeras/src/backend/torch/trainer.py466 # Create an iterator that yields batches of input/target data.COMMENT
MEDIUMkeras/src/backend/torch/trainer.py516 # Create an iterator that yields batches of input data.COMMENT
MEDIUMkeras/src/backend/torch/ops/nn.py421 # Create a real tensor to execute the ops.COMMENT
MEDIUMkeras/src/backend/numpy/trainer.py172 # Create an iterator that yields batches of input data.COMMENT
MEDIUMkeras/src/backend/numpy/trainer.py242 # Create an iterator that yields batches of input/target data.COMMENT
MEDIUMkeras/src/backend/common/remat.py177 # Define a simple model using the custom layerSTRING
MEDIUMkeras/src/backend/common/name_scope_test.py55 # Create a name_scope instanceCOMMENT
MEDIUMkeras/src/backend/common/name_scope_test.py72 # Create a name_scope instanceCOMMENT
MEDIUMkeras/src/backend/common/name_scope_test.py118 # Create a name_scope but don't enter itCOMMENT
MEDIUMkeras/src/backend/common/remat_test.py123 # Define a function that uses keyword argumentsCOMMENT
MEDIUMkeras/src/backend/common/variables_test.py1264 # Create a mock SymInt objectCOMMENT
MEDIUMkeras/src/backend/common/symbolic_scope_test.py11 # Define a function that behaves differently according toCOMMENT
MEDIUMkeras/src/backend/tensorflow/trainer.py344 # Create the validation data using the training data. Only supportedCOMMENT
MEDIUMkeras/src/backend/tensorflow/trainer.py360 # Create an iterator that yields batches for one epoch.COMMENT
MEDIUMkeras/src/backend/tensorflow/trainer.py477 # Create an iterator that yields batches of input/target data.COMMENT
MEDIUMkeras/src/backend/tensorflow/trainer.py526 # Create an iterator that yields batches of input data.COMMENT
MEDIUMkeras/src/backend/tensorflow/ops/numpy.py3801 # Create a smaller square eye and pad appropriately.COMMENT
MEDIUM…src/backend/jax/jax_multi_process_distribution_test.py97 # Create a dataset with range, so that we can verify the numericalCOMMENT
MEDIUMkeras/src/backend/jax/trainer.py146 """This method is stateless and is intended for use with jax.grad."""STRING
MEDIUMkeras/src/backend/jax/trainer.py455 # Create the validation data using the training data. Only supportedCOMMENT
MEDIUMkeras/src/backend/jax/trainer.py471 # Create an iterator that yields batches for one epoch.COMMENT
MEDIUMkeras/src/backend/jax/trainer.py636 # Create an iterator that yields batches ofCOMMENT
MEDIUMkeras/src/backend/jax/trainer.py721 # Create an iterator that yields batches of input data.COMMENT
MEDIUMkeras/src/backend/jax/ops/core.py462 # Create a _DimExpr instance for one dimension by creating a symbolicCOMMENT
MEDIUMkeras/src/models/model_test.py997 # Create the parameter lists before quantization.COMMENT
MEDIUMkeras/src/models/cloning.py81 # Create a test Sequential model.STRING
MEDIUMkeras/src/models/cloning.py87 # Create a copy of the test model (with freshly initialized weights).STRING
MEDIUMkeras/src/models/model.py554 # Create a custom configSTRING
MEDIUM…/src/trainers/data_adapters/tf_dataset_adapter_test.py194 # Create a tf.data Dataset from the input data and two target outputsCOMMENT
25 more matches not shown…
Empty Error Handlers44 hits · 220 pts
SeverityFileLineSnippetContext
HIGHpip_build.py30except ImportError:CODE
HIGHkeras/src/activations/activations.py164except AttributeError:CODE
HIGHkeras/src/activations/activations.py503except AttributeError:CODE
HIGHkeras/src/tree/optree_impl.py37except ValueError:CODE
HIGHkeras/src/layers/layer_test.py771except RuntimeError:CODE
HIGHkeras/src/layers/attention/multi_head_attention_test.py1014except:CODE
HIGHkeras/src/layers/attention/multi_head_attention_test.py1039except:CODE
HIGHkeras/src/layers/rnn/bidirectional.py209except NotImplementedError:CODE
HIGHkeras/src/layers/rnn/bidirectional.py214except NotImplementedError:CODE
HIGHkeras/src/layers/rnn/lstm.py579except NotImplementedError:CODE
HIGHkeras/src/layers/rnn/gru.py595except NotImplementedError:CODE
HIGHkeras/src/callbacks/orbax_checkpoint_test.py435except Exception:CODE
HIGHkeras/src/callbacks/orbax_checkpoint_test.py504except:CODE
HIGHkeras/src/callbacks/orbax_checkpoint.py23except ImportError:CODE
HIGHkeras/src/legacy/saving/json_utils.py126except ValueError:CODE
HIGHkeras/src/legacy/saving/serialization.py214except TypeError:CODE
HIGHkeras/src/utils/model_visualization.py114except (ValueError, AttributeError):CODE
HIGHkeras/src/utils/model_visualization.py149except (ValueError, AttributeError):CODE
HIGHkeras/src/utils/model_visualization.py528except ImportError:CODE
HIGHkeras/src/utils/summary_utils_test.py42except ImportError:CODE
HIGHkeras/src/utils/numerical_utils.py154except ValueError:CODE
HIGHkeras/src/utils/python_utils.py179except:CODE
HIGHkeras/src/backend/config.py342except OSError:CODE
HIGHkeras/src/backend/config.py357except IOError:CODE
HIGHkeras/src/backend/torch/rnn.py617except Exception:CODE
HIGHkeras/src/backend/torch/rnn.py807except Exception:CODE
HIGHkeras/src/backend/torch/ops/core.py815except (TypeError, RuntimeError):CODE
HIGHkeras/src/backend/torch/ops/numpy.py163except RuntimeError:CODE
HIGHkeras/src/backend/common/variables.py404except:CODE
HIGHkeras/src/backend/tensorflow/trackable.py21except AttributeError:CODE
HIGHkeras/src/backend/tensorflow/ops/core.py208except:CODE
HIGHkeras/src/backend/jax/ops/core.py340except ValueError:CODE
HIGHkeras/src/backend/jax/ops/linalg.py23except jax.errors.TracerBoolConversionError:CODE
HIGHkeras/src/models/model.py758except:CODE
HIGHkeras/src/models/model.py770except:CODE
HIGHkeras/src/models/functional.py407except ValueError:CODE
HIGHkeras/src/trainers/trainer_test.py2010except:CODE
HIGHkeras/src/trainers/data_adapters/py_dataset_adapter.py166except NotImplementedError:CODE
HIGHkeras/src/trainers/data_adapters/py_dataset_adapter.py740except queue.Empty:CODE
HIGHkeras/src/trainers/data_adapters/py_dataset_adapter.py751except queue.Empty:CODE
HIGHkeras/src/trainers/data_adapters/data_adapter_utils.py543except StopIteration:CODE
HIGHkeras/src/trainers/data_adapters/data_adapter_utils.py570except (ValueError, RuntimeError):CODE
HIGHkeras/src/ops/operation.py244except RecursionError:CODE
HIGHkeras/src/export/onnx.py284except Exception:CODE
AI Structural Patterns191 hits · 190 pts
SeverityFileLineSnippetContext
LOWkeras/src/visualization/plot_bounding_box_gallery.py18CODE
LOW…as/src/visualization/plot_segmentation_mask_gallery.py15CODE
LOWkeras/src/visualization/plot_image_gallery.py45CODE
LOWkeras/src/metrics/confusion_metrics.py1189CODE
LOWkeras/src/losses/losses.py903CODE
LOWkeras/src/losses/losses.py1164CODE
LOWkeras/src/losses/losses.py1281CODE
LOWkeras/src/layers/input_spec.py51CODE
LOWkeras/src/layers/layer.py522CODE
LOWkeras/src/layers/attention/grouped_query_attention.py102CODE
LOWkeras/src/layers/attention/grouped_query_attention.py256CODE
LOWkeras/src/layers/attention/grouped_query_attention.py612CODE
LOWkeras/src/layers/attention/multi_head_attention.py114CODE
LOWkeras/src/layers/attention/multi_head_attention.py611CODE
LOWkeras/src/layers/attention/multi_head_attention.py867CODE
LOWkeras/src/layers/core/ternary_dense.py110CODE
LOWkeras/src/layers/core/embedding.py81CODE
LOWkeras/src/layers/core/dense.py77CODE
LOWkeras/src/layers/core/input_layer.py146CODE
LOWkeras/src/layers/core/input_layer.py11CODE
LOWkeras/src/layers/core/einsum_dense.py120CODE
LOWkeras/src/layers/normalization/batch_normalization.py160CODE
LOWkeras/src/layers/normalization/layer_normalization.py106CODE
LOWkeras/src/layers/normalization/group_normalization.py67CODE
LOWkeras/src/layers/convolutional/base_depthwise_conv.py83CODE
LOWkeras/src/layers/convolutional/depthwise_conv2d.py101CODE
LOWkeras/src/layers/convolutional/depthwise_conv1d.py100CODE
LOWkeras/src/layers/convolutional/base_conv_transpose.py71CODE
LOWkeras/src/layers/convolutional/separable_conv2d.py99CODE
LOWkeras/src/layers/convolutional/separable_conv1d.py98CODE
LOWkeras/src/layers/convolutional/conv3d_transpose.py113CODE
LOWkeras/src/layers/convolutional/conv1d.py95CODE
LOWkeras/src/layers/convolutional/conv2d_transpose.py109CODE
LOWkeras/src/layers/convolutional/conv3d.py95CODE
LOWkeras/src/layers/convolutional/conv2d.py98CODE
LOWkeras/src/layers/convolutional/conv1d_transpose.py101CODE
LOWkeras/src/layers/convolutional/base_separable_conv.py77CODE
LOWkeras/src/layers/convolutional/base_conv.py90CODE
LOWkeras/src/layers/preprocessing/mel_spectrogram.py87CODE
LOWkeras/src/layers/preprocessing/index_lookup.py119CODE
LOWkeras/src/layers/preprocessing/integer_lookup.py335CODE
LOWkeras/src/layers/preprocessing/text_vectorization.py219CODE
LOWkeras/src/layers/preprocessing/stft_spectrogram.py134CODE
LOWkeras/src/layers/preprocessing/string_lookup.py302CODE
LOW…essing/image_preprocessing/random_elastic_transform.py84CODE
LOW…rc/layers/preprocessing/image_preprocessing/aug_mix.py86CODE
LOWkeras/src/layers/merging/dot.py323CODE
LOWkeras/src/layers/rnn/conv_lstm3d.py122CODE
LOWkeras/src/layers/rnn/conv_lstm2d.py123CODE
LOWkeras/src/layers/rnn/lstm.py88CODE
LOWkeras/src/layers/rnn/lstm.py448CODE
LOWkeras/src/layers/rnn/gru.py86CODE
LOWkeras/src/layers/rnn/gru.py465CODE
LOWkeras/src/layers/rnn/conv_lstm1d.py123CODE
LOWkeras/src/layers/rnn/simple_rnn.py79CODE
LOWkeras/src/layers/rnn/simple_rnn.py297CODE
LOWkeras/src/layers/rnn/conv_lstm.py85CODE
LOWkeras/src/layers/rnn/conv_lstm.py472CODE
LOWkeras/src/callbacks/reduce_lr_on_plateau.py48CODE
LOWkeras/src/callbacks/orbax_checkpoint.py110CODE
131 more matches not shown…
Decorative Section Separators18 hits · 69 pts
SeverityFileLineSnippetContext
MEDIUM⚡keras/src/backend/jax/trainer_test.py33 # ----------------------------------------------------------------COMMENT
MEDIUM⚡keras/src/backend/jax/trainer_test.py35 # ----------------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py469 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py471 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py480 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py482 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py585 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py587 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py590 # ------------------------------------------------------COMMENT
MEDIUM⚡keras/src/saving/file_editor.py592 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py499 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py501 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py528 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py530 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py551 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py553 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py572 # ------------------------------------------------------COMMENT
MEDIUMkeras/src/saving/file_editor.py574 # ------------------------------------------------------COMMENT
Excessive Try-Catch Wrapping50 hits · 52 pts
SeverityFileLineSnippetContext
LOWkeras/src/wrappers/sklearn_test.py158 except Exception as exc:CODE
LOWkeras/src/wrappers/sklearn_test.py212 except Exception as exc:CODE
LOWkeras/src/layers/layer.py1771 except Exception as e:CODE
LOWkeras/src/callbacks/orbax_checkpoint_test.py435 except Exception:CODE
LOWkeras/src/callbacks/orbax_checkpoint.py357 except Exception as e:CODE
LOWkeras/src/callbacks/tensorboard.py638 except Exception as e:CODE
LOWkeras/src/callbacks/tensorboard.py652 except Exception as e:CODE
LOWkeras/src/callbacks/tensorboard.py694 except Exception as exc:CODE
LOWkeras/src/utils/traceback_utils.py118 except Exception as e:CODE
LOWkeras/src/utils/traceback_utils.py153 except Exception:CODE
LOW⚡keras/src/utils/traceback_utils.py197 except Exception:CODE
LOW⚡keras/src/utils/traceback_utils.py201 except Exception:CODE
LOWkeras/src/utils/traceback_utils.py249 except Exception:CODE
LOWkeras/src/backend/torch/rnn.py617 except Exception:CODE
LOWkeras/src/backend/torch/rnn.py807 except Exception:CODE
LOWkeras/src/backend/torch/ops/core.py328 except Exception:CODE
MEDIUMkeras/src/backend/torch/ops/core.py325def __eq__(self, other):CODE
LOWkeras/src/backend/common/variables.py641 except Exception as e:CODE
LOWkeras/src/backend/jax/ops/nn.py1809 except Exception:CODE
LOWkeras/src/backend/jax/ops/nn.py1831 except Exception:CODE
LOWkeras/src/trainers/trainer.py1186 except Exception as e:CODE
LOWkeras/src/trainers/data_adapters/py_dataset_adapter.py720 except Exception as e:CODE
LOWkeras/src/trainers/data_adapters/py_dataset_adapter.py753 except Exception as e:CODE
LOWkeras/src/dtype_policies/dtype_policy_map.py229 except Exception:CODE
LOWkeras/src/ops/core.py1087 except Exception as e:CODE
LOWkeras/src/ops/numpy.py7595 except Exception:CODE
LOWkeras/src/ops/operation.py60 except Exception as e:CODE
LOWkeras/src/ops/operation.py148 except Exception as e:CODE
LOWkeras/src/ops/operation.py364 except Exception as e:CODE
MEDIUMkeras/src/ops/operation.py145def compute_output_spec(self, *args, **kwargs):CODE
LOWkeras/src/ops/linalg.py47 except Exception as e:CODE
LOWkeras/src/ops/linalg.py93 except Exception as e:CODE
LOWkeras/src/saving/file_editor.py82 except Exception:CODE
LOWkeras/src/saving/saving_lib.py733 except Exception:CODE
LOWkeras/src/saving/saving_lib.py837 except Exception as e:CODE
LOWkeras/src/saving/saving_lib.py849 except Exception as e:CODE
LOWkeras/src/export/openvino_test.py110 except Exception as e:CODE
LOWkeras/src/export/openvino_test.py165 except Exception as e:CODE
LOWkeras/src/export/openvino_test.py200 except Exception as e:CODE
LOWkeras/src/export/openvino_test.py233 except Exception as e:CODE
LOWkeras/src/export/onnx.py284 except Exception:CODE
LOWkeras/src/export/litert_torch_test.py45 except Exception:CODE
LOWkeras/src/export/tf2onnx_lib.py127 except Exception as ex:CODE
LOWkeras/src/export/torch.py100 except Exception as e:CODE
LOWkeras/src/export/litert.py245 except Exception as e:CODE
LOWintegration_tests/pytorch_export_test.py102 except Exception as e:CODE
LOWintegration_tests/pytorch_export_test.py163 except Exception as e:CODE
LOWintegration_tests/pytorch_export_test.py179 except Exception as e:CODE
LOWintegration_tests/pytorch_export_test.py246 except Exception as e:CODE
LOWintegration_tests/pytorch_export_test.py297 except Exception as e:CODE
Redundant / Tautological Comments28 hits · 42 pts
SeverityFileLineSnippetContext
LOWkeras/src/tree/dmtree_impl.py207 # Check if the reference entry (first one) is NoneCOMMENT
LOWkeras/src/tree/torchtree_impl.py154 # Check if the reference entry (first one) is NoneCOMMENT
LOWkeras/src/losses/losses_test.py1230 # Check if any SyntaxWarning was issuedCOMMENT
LOWkeras/src/losses/losses_test.py2066 # Check if any SyntaxWarning was issuedCOMMENT
LOWkeras/src/layers/core/embedding.py297 # Check if the attribute exists on the instance before saving.COMMENT
LOWkeras/src/layers/core/embedding.py345 # Check if the attribute exists before attempting to assign.COMMENT
LOWkeras/src/layers/normalization/batch_normalization.py340 # Check if the mask has one less dimension than the inputs.COMMENT
LOWkeras/src/layers/preprocessing/feature_space.py530 # Check if the dataset needs batchingCOMMENT
LOWkeras/src/layers/rnn/time_distributed.py79 # Check if mask has at least 2 dimensions (batch and timesteps)COMMENT
LOWkeras/src/callbacks/orbax_checkpoint.py196 # Check if JAX distributed client is initializedCOMMENT
LOWkeras/src/distillation/distiller_test.py101 # Check if the model has been compiled (different backends may handleCOMMENT
LOWkeras/src/legacy/saving/serialization.py362 # Check if `cls_config` is a list. If it is a list, return the class and theCOMMENT
LOWkeras/src/utils/image_utils.py295 # Set back to input height / widthCOMMENT
LOWkeras/src/utils/image_utils.py409 # Set back to input height / width if crop_height / crop_width is notCOMMENT
LOWkeras/src/backend/torch/rnn.py433 # Check if mask is valid for cuDNNCOMMENT
LOWkeras/src/backend/jax/ops/nn.py1496 # Check if cuDNN is installed and raise RuntimeError if cuDNN is notCOMMENT
LOWkeras/src/models/model.py963 # Check if LiteRT export is available (requires TensorFlow orCOMMENT
LOWkeras/src/models/model.py973 # Check if Torch export is available (requires PyTorch backend)COMMENT
LOWkeras/src/trainers/data_adapters/tf_dataset_adapter.py49 # Check if the dataset is batched.COMMENT
LOWkeras/src/ops/ops_test.py56 # Check if that function exist. Some classes are abstract superCOMMENT
LOWkeras/src/ops/function.py134 # Check if input shapes are identical to ref input shapes,COMMENT
LOWkeras/src/saving/file_editor.py30 # Check if an active IPython shell exists.COMMENT
LOWkeras/src/saving/serialization_lib_test.py447 # Check if it resolves to the canonical keras activation functionCOMMENT
LOWkeras/src/export/onnx.py288 # Set verbose to False for TorchScript due to file system leakageCOMMENT
LOWintegration_tests/dataset_tests/imdb_test.py35 # Check if top 10 words are skipped properlyCOMMENT
LOWintegration_tests/dataset_tests/imdb_test.py46 # Check if word_index contains specific known wordsCOMMENT
LOWintegration_tests/dataset_tests/reuters_test.py43 # Check if word_index contains specific known wordsCOMMENT
LOWintegration_tests/dataset_tests/reuters_test.py49 # Check if the tuple contains specific known labelsCOMMENT
Over-Commented Block49 hits · 42 pts
SeverityFileLineSnippetContext
LOWkeras/src/tree/dmtree_impl.py1import collectionsCOMMENT
LOWkeras/src/metrics/confusion_metrics_test.py1161 # without sample_weight:COMMENT
LOWkeras/src/metrics/confusion_metrics_test.py1561 # tn = [[0, 1, 2, 2, 2], [0, 2, 2, 2, 2]]COMMENT
LOWkeras/src/metrics/metrics_utils.py141 bucket_index(y_pred) = ops.floor(y_pred * num_buckets)COMMENT
LOWkeras/src/layers/layer.py961 self._assert_input_compatibility(call_spec.first_arg)COMMENT
LOWkeras/src/layers/preprocessing/hashing_test.py441COMMENT
LOWkeras/src/layers/preprocessing/hashing_test.py461# # Same hashed output as test_hash_sparse_input_farmhashCOMMENT
LOWkeras/src/layers/preprocessing/hashing_test.py481# empty_mask_output = empty_mask_layer(inp_data)COMMENT
LOWkeras/src/layers/preprocessing/hashing_test.py501# self.assertAllClose(expected_output[1], out_data[1])COMMENT
LOWkeras/src/layers/preprocessing/hashing_test.py521COMMENT
LOWkeras/src/layers/preprocessing/hashing_test.py541# # Same hashed output as test_hash_sparse_input_farmhashCOMMENT
LOW…/preprocessing/image_preprocessing/center_crop_test.py181 # np.random.rand(10, 10, 3),COMMENT
LOWkeras/src/callbacks/callback.py81COMMENT
LOWkeras/src/callbacks/tensorboard_test.py521 # self.assertEqual(COMMENT
LOWkeras/src/callbacks/tensorboard_test.py701 # Dense(1),COMMENT
LOWkeras/src/callbacks/tensorboard_test.py721COMMENT
LOWkeras/src/quantizers/strategy_registry.py61COMMENT
LOWkeras/src/datasets/npz_utils.py1"""Utilities shared by the built-in datasets."""COMMENT
LOWkeras/src/distribution/distribution_lib_test.py621# cpus = tf.config.list_physical_devices("cpu")COMMENT
LOWkeras/src/distribution/distribution_lib_test.py641# axis_names = ["batch", "model"]COMMENT
LOWkeras/src/distribution/distribution_lib_test.py661# )COMMENT
LOWkeras/src/utils/model_visualization.py361 # No nesting, connect directly.COMMENT
LOWkeras/src/backend/torch/ops/nn.py301COMMENT
LOWkeras/src/backend/torch/ops/numpy.py201 ori_dtype = standardize_dtype(x.dtype)COMMENT
LOWkeras/src/backend/common/dtypes.py121COMMENT
LOWkeras/src/backend/tensorflow/random.py141 dtype,COMMENT
LOWkeras/src/backend/tensorflow/rnn.py901 # after batch dim for time major or batch major inputs respectivelyCOMMENT
LOWkeras/src/backend/jax/ops/core.py461COMMENT
LOWkeras/src/optimizers/optimizer_sparse_test.py141 ):COMMENT
LOWkeras/src/trainers/data_adapters/array_data_adapter.py141 num_samples = self._num_samplesCOMMENT
LOWkeras/src/testing/test_case.py501 # Single op loss to avoid compilation issues with ragged / sparse.COMMENT
LOWkeras/src/ops/image_test.py1841 def test_resize_uint8_round(self):COMMENT
LOWkeras/src/ops/image_test.py1881 expected = np.array(COMMENT
LOWkeras/src/saving/saving_lib_test.py441 self.assertIn("keras_version", metadata)COMMENT
LOWkeras/src/saving/saving_lib.py401 model = deserialize_keras_object(COMMENT
LOWkeras/src/export/saved_model_export_archive.py361 # input signature raises `TypeError: missing aCOMMENT
LOWintegration_tests/model_visualization_test.py321 # | sub (Sequential) |COMMENT
LOWintegration_tests/model_visualization_test.py381 edge_dict = get_edge_dict(model_to_dot(model))COMMENT
LOWintegration_tests/model_visualization_test.py401 # | v |COMMENT
LOWintegration_tests/model_visualization_test.py441 keras.layers.Dense(10, name="dense1"),COMMENT
LOWintegration_tests/model_visualization_test.py481 # | | inner v | |COMMENT
LOWintegration_tests/model_visualization_test.py521 model = keras.models.Sequential(COMMENT
LOWintegration_tests/model_visualization_test.py561 # | mid | |COMMENT
LOWintegration_tests/model_visualization_test.py601COMMENT
LOWintegration_tests/model_visualization_test.py641 # | +-------------------------+ |COMMENT
LOWintegration_tests/model_visualization_test.py721 )COMMENT
LOWintegration_tests/model_visualization_test.py741 {COMMENT
LOWintegration_tests/model_visualization_test.py761 # | | | dense0 | | | |inner_inp1t| |inner_inp2t| | | subclass3 | |COMMENT
LOWexamples/demo_jax_distributed.py181# Use Keras APIs to find the variable of a specific layer (we will be sharding this one in a special way)COMMENT
AI Slop Vocabulary14 hits · 32 pts
SeverityFileLineSnippetContext
LOWkeras/src/activations/__init__.py101 # Case for keras.activations builtins (simply return name)COMMENT
MEDIUMkeras/src/metrics/confusion_metrics.py1493 # Due to the hyperbolic transform, this formula is less robust thanCOMMENT
LOWkeras/src/layers/normalization/batch_normalization.py27 # If we get a string or dict, just return as we cannot and should not clone.COMMENT
MEDIUMkeras/src/layers/rnn/lstm.py558 # TF for instance, it will leverage cuDNN when feasible, andCOMMENT
MEDIUMkeras/src/layers/rnn/gru.py574 # TF for instance, it will leverage cuDNN when feasible, andCOMMENT
MEDIUMkeras/src/callbacks/orbax_checkpoint_test.py547 """Test comprehensive model state restoration with exact weightSTRING
MEDIUMkeras/src/callbacks/early_stopping_test.py286 # in conjunction with 'start_from_epoch'.COMMENT
LOWkeras/src/legacy/saving/serialization.py241 # already serialized this config. If so, just use that config. This willCOMMENT
LOWkeras/src/utils/text_dataset_utils_test.py72 # We just return the texts, no labelsCOMMENT
MEDIUMkeras/src/backend/torch/ops/core.py499 # more robust, but more expensive.COMMENT
MEDIUMkeras/src/backend/tensorflow/ops/numpy.py354 # Replace tf.einsum with custom ops to utilize hardware-acceleratedCOMMENT
MEDIUMkeras/src/backend/tensorflow/ops/numpy.py3906 # unfortunately we can't leverage 'SAME' padding directly likeCOMMENT
LOWkeras/src/trainers/data_adapters/py_dataset_adapter.py788 # If a worker dies during init, the pool will just create a replacement.COMMENT
MEDIUMkeras/src/ops/function.py155 # Wrap `input_shape` into the structure of KerasTensor to utilizeCOMMENT
Verbosity Indicators5 hits · 10 pts
SeverityFileLineSnippetContext
LOW⚡keras/src/quantizers/awq.py342 # Step 1: Find optimal AWQ scales via grid searchCOMMENT
LOW⚡keras/src/quantizers/awq.py350 # Step 2: Apply AWQ scales by MULTIPLYING (expand salient weights)COMMENT
LOW⚡keras/src/quantizers/awq.py354 # Step 3: (Optional) Search and apply per-group clipping bounds.COMMENT
LOWkeras/src/saving/saving_api.py416 # Step 1: Load model_config to rebuild the model.COMMENT
LOWkeras/src/saving/saving_api.py434 # Step 2: Load pytree (arrays) with optional resharding.COMMENT
Cross-Language Confusion1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHkeras/src/tree/dmtree_impl.py24# non-sortable keys as unsupported (meaning behavior is undefined).COMMENT
Structural Annotation Overuse4 hits · 8 pts
SeverityFileLineSnippetContext
LOW⚡keras/src/quantizers/awq.py342 # Step 1: Find optimal AWQ scales via grid searchCOMMENT
LOW⚡keras/src/quantizers/awq.py350 # Step 2: Apply AWQ scales by MULTIPLYING (expand salient weights)COMMENT
LOWkeras/src/saving/saving_api.py416 # Step 1: Load model_config to rebuild the model.COMMENT
LOWkeras/src/saving/saving_api.py434 # Step 2: Load pytree (arrays) with optional resharding.COMMENT
Fake / Example Data4 hits · 6 pts
SeverityFileLineSnippetContext
LOWkeras/src/backend/torch/ops/core_test.py42 if node.op == "placeholder":CODE
LOW⚡keras/src/backend/jax/ops/core.py150 dummy_value = jnp.array(0.0)CODE
LOW⚡keras/src/backend/jax/ops/core.py152 dummy_value = jnp.zeros(shape, dtype=standardize_dtype(dtype))CODE
LOW⚡keras/src/backend/jax/ops/core.py155 nnx.Variable.__init__(self, value=dummy_value, **nnx_metadata)CODE
Slop Phrases5 hits · 5 pts
SeverityFileLineSnippetContext
MEDIUMkeras/src/layers/preprocessing/text_vectorization.py190 >>> # Now, the layer can map strings to integers -- you can use anSTRING
MEDIUMkeras/src/constraints/constraints.py17 Here's a simple example of a non-negative weight constraint:STRING
MEDIUMkeras/src/utils/dataset_utils.py63 >>> # For a tf.data.Dataset, you can use .cardinality()STRING
MEDIUMkeras/src/utils/dataset_utils.py66 >>> # For a torch.utils.data.Dataset, you can use len()STRING
MEDIUMkeras/src/initializers/initializer.py34 Here's a simple example: a random normal initializer.STRING
Modern AI Meta-Vocabulary1 hit · 4 pts
SeverityFileLineSnippetContext
MEDIUM⚡keras/src/quantizers/strategy_registry.py263 # --- Model-level orchestration ----------------------------------------COMMENT
Overly Generic Function Names4 hits · 4 pts
SeverityFileLineSnippetContext
LOWkeras/src/utils/python_utils_test.py10 def my_function(x, y=1, **kwargs):CODE
LOWkeras/src/backend/torch/trainer.py206 def test_function(data):CODE
LOWkeras/src/backend/jax/distribution_lib_test.py99 def test_function(inputs, target_layout):CODE
LOWkeras/src/backend/jax/distribution_lib_test.py125 def test_function(inputs, target_layout):CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWkeras/src/wrappers/__init__.py5__all__ = ["SKLearnClassifier", "SKLearnRegressor", "SKLearnTransformer"]CODE