Skip to content

Commit f0ab75d

Browse files
Remove tensorflow/keras files and the keras dependency (#15420)
Per discussion in #15418, these four files are not algorithms (they are how-to-use scripts wrapping a deep-learning framework) and dragged in the heavy keras/tensorflow dependency stack: - computer_vision/cnn_classification.py - dynamic_programming/k_means_clustering_tensorflow.py - machine_learning/lstm/lstm_prediction.py - neural_network/input_data.py (TF MNIST data loader; nothing imports it) Also removes the now-orphaned machine_learning/lstm/ package (only __init__.py + sample_data.csv, which served lstm_prediction.py). Cleanups: - Drop keras from pyproject.toml dependencies; regenerate uv.lock (removes absl-py, h5py, keras, ml-dtypes, namex, optree). - Remove the pre-release libhdf5-dev install step from build.yml and sphinx.yml (it existed only because keras needs hdf5). - Drop the four stale pytest --ignore entries in build.yml. - Remove the four DIRECTORY.md entries and the empty Lstm heading.
1 parent c4246f0 commit f0ab75d

11 files changed

Lines changed: 46 additions & 2131 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ jobs:
2020
with:
2121
python-version-file: .python-version
2222
allow-prereleases: true
23-
# keras needs hdf5 on pre-release Python.
24-
- run: |
25-
if [ "$(python -c 'import sys; print(sys.version_info.releaselevel)')" != "final" ]; then
26-
sudo apt-get update -qq
27-
sudo apt-get install --yes libhdf5-dev
28-
fi
2923
- run: uv sync --group=test
3024
- name: Run tests
3125
# opencv-python is gated out on 3.14t (no cp314t wheel yet), so skip the
@@ -41,16 +35,12 @@ jobs:
4135
# single file that imports it (quantum/q_fourier_transform.py) is skipped too.
4236
run: uv run --with=pytest-run-parallel pytest
4337
--iterations=8 --parallel-threads=auto --ignore-gil-enabled
44-
--ignore=computer_vision/cnn_classification.py
4538
--ignore=computer_vision/flip_augmentation.py
4639
--ignore=computer_vision/harris_corner.py
4740
--ignore=computer_vision/mosaic_augmentation.py
4841
--ignore=data_compression/peak_signal_to_noise_ratio.py
4942
--ignore=digital_image_processing/
5043
--ignore=docs/conf.py
51-
--ignore=dynamic_programming/k_means_clustering_tensorflow.py
52-
--ignore=machine_learning/lstm/lstm_prediction.py
53-
--ignore=neural_network/input_data.py
5444
--ignore=project_euler/
5545
--ignore=quantum/q_fourier_transform.py
5646
--ignore=scripts/validate_solutions.py

‎.github/workflows/sphinx.yml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ jobs:
3333
with:
3434
python-version-file: .python-version
3535
allow-prereleases: true
36-
# keras needs hdf5 on pre-release Python.
37-
- run: |
38-
if [ "$(python -c 'import sys; print(sys.version_info.releaselevel)')" != "final" ]; then
39-
sudo apt-get update -qq
40-
sudo apt-get install --yes libhdf5-dev
41-
fi
4236
- run: uv sync --group=docs
4337
- uses: actions/configure-pages@v6
4438
- run: uv run sphinx-build -c docs . docs/_build/html

‎DIRECTORY.md‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@
195195
* [Xtea](ciphers/xtea.py)
196196

197197
## [Computer Vision](computer_vision)
198-
* [Cnn Classification](computer_vision/cnn_classification.py)
199198
* [Flip Augmentation](computer_vision/flip_augmentation.py)
200199
* [Gramian](computer_vision/gramian.py)
201200
* [Haralick Descriptors](computer_vision/haralick_descriptors.py)
@@ -474,7 +473,6 @@
474473
* [Floyd Warshall](dynamic_programming/floyd_warshall.py)
475474
* [Integer Partition](dynamic_programming/integer_partition.py)
476475
* [Iterating Through Submasks](dynamic_programming/iterating_through_submasks.py)
477-
* [K Means Clustering Tensorflow](dynamic_programming/k_means_clustering_tensorflow.py)
478476
* [Knapsack](dynamic_programming/knapsack.py)
479477
* [Largest Divisible Subset](dynamic_programming/largest_divisible_subset.py)
480478
* [Longest Common Subsequence](dynamic_programming/longest_common_subsequence.py)
@@ -766,8 +764,6 @@
766764
* [Local Weighted Learning](machine_learning/local_weighted_learning/local_weighted_learning.py)
767765
* [Logistic Regression](machine_learning/logistic_regression.py)
768766
* [Loss Functions](machine_learning/loss_functions.py)
769-
* Lstm
770-
* [Lstm Prediction](machine_learning/lstm/lstm_prediction.py)
771767
* [Mab](machine_learning/mab.py)
772768
* [Mean Shift](machine_learning/mean_shift.py)
773769
* [Mfcc](machine_learning/mfcc.py)
@@ -1058,7 +1054,6 @@
10581054
* [Swish](neural_network/activation_functions/swish.py)
10591055
* [Back Propagation Neural Network](neural_network/back_propagation_neural_network.py)
10601056
* [Convolution Neural Network](neural_network/convolution_neural_network.py)
1061-
* [Input Data](neural_network/input_data.py)
10621057
* Optimizers
10631058
* [Adagrad](neural_network/optimizers/adagrad.py)
10641059
* [Adam Optimizer](neural_network/optimizers/adam_optimizer.py)

‎computer_vision/cnn_classification.py‎

Lines changed: 0 additions & 99 deletions
This file was deleted.

‎dynamic_programming/k_means_clustering_tensorflow.py‎

Lines changed: 0 additions & 146 deletions
This file was deleted.

‎machine_learning/lstm/__init__.py‎

Whitespace-only changes.

‎machine_learning/lstm/lstm_prediction.py‎

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)