88 Commits
Author SHA1 Message Date
Christian Clauss 3dae007c74 More ruff rules ANN for type annotations (#15443) 2026-09-26 17:27:43 +02:00
Christian Claussandcclauss eb3776a015 Delete neural_network/gan.py_tf (#15423)
* Delete neural_network/gan.py_tf

* updating DIRECTORY.md

---------

Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 12:39:47 +01:00
Shashank Tyagipre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
bc1f8a8bb2 Adding LSTM algorithm from scratch in neural network algorithm sections (#12082)
* added lstm algorithm in neural network section.

* commented the testing lines of code

* modified code to meet contribution.md file guidelines

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add LSTM algorithm implementation in neural network section

* shorten the individual lines

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* shorten the lines

* Refactor LSTM input data initialization

* Refactor LSTM network implementation and improve code readability

* changed code a bit for meet ruff standards

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactor LSTM class to improve code readability and maintainability

* Refactor tqdm import in LSTM class

* Refactor tqdm import in LSTM class

* added doc tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* descriptive names + improved doctests

* Refactor LSTM class: Increase training epochs to 100

* Refactor LSTM class: Improve test method and add comments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added doct tests for each function

* added type hints in lstm init

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed type hints which were repeating in code

* written doc tests for backward pass and forward pass, fixed variable names in sigmoid function from x to input array

* fixed return type of test function to str from none

* Refactor LSTM implementation and clean up code

Removed author information and unused print statements. Updated parameter names in docstrings for consistency.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Rename stm_model to lstm_model in lstm.py

* Fix parameter name in sigmoid and tanh methods

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-24 11:57:28 +02:00
priya-sundaram-dev f0ab75d0d2 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.
2026-09-24 04:45:23 +02:00
Pritam Daspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
692d38ff6f shortened the lines (#12214)
* Create README.md

* Update README.md

* Add files via upload

* Delete llm_experiments directory

* Create README.md

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add files via upload

* Delete neural_network/chatbot/main.py

* Delete neural_network/chatbot/llm_service.py

* Delete neural_network/chatbot/chatbot.py

* Delete neural_network/chatbot/db.py

* Update README.md

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add files via upload

made changes suggested by auto-checker

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add files via upload

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Delete neural_network/chatbot directory

* Add files via upload

* Add files via upload

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add files via upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updating DIRECTORY.md

* Rename batch_size variable to _batch_size

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-23 15:46:57 +02:00
89a96019e9 feat: Add Softsign activation function (#13133)
* feat: add softsign activation function

* refactor: formatting

* refactor: detailed docs

* Fix reference link in softsign.py docstring

Updated the reference link for the softsign activation function.

* updating DIRECTORY.md

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-20 08:27:56 +02:00
Christian Clauss 0525ef5da8 ruff rule ANN202 missing-return-type-private-function (#15298)
* ruff rule ANN202 missing-return-type-private-function

* ruff rule ANN202 missing-return-type-private-function
2026-09-12 21:47:08 +02:00
Christian Clauss 0da45b148a ruff rule ANN204 missing-return-type-special-method (#15300) 2026-09-12 21:35:04 +02:00
a7029989d6 Add Momentum SGD optimizer implementation (#13680)
* Add Momentum SGD optimizer implementation

- Implements SGD with momentum using pure NumPy
- Includes comprehensive docstrings and type hints
- Adds doctests for validation
- Provides usage example demonstrating convergence
- Follows PEP8 coding standards

* updating DIRECTORY.md

* updating DIRECTORY.md

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-12 00:15:59 +02:00
f644edd6dc Added Nesterov and Adam Optimizers (#13718)
* Add Adagrad optimizer implementation

- Implements Adagrad (Adaptive Gradient) using pure NumPy
- Adapts learning rate individually for each parameter
- Includes comprehensive docstrings and type hints
- Adds doctests for validation
- Provides usage example demonstrating convergence
- Follows PEP8 coding standards
- Part of issue #13662

* Add Adam and Nesterov Accelerated Gradient optimizers

- Implements Adam (Adaptive Moment Estimation) optimizer
- Implements Nesterov Accelerated Gradient (NAG) optimizer
- Both use pure NumPy without deep learning frameworks
- Includes comprehensive docstrings and type hints
- Adds doctests for validation
- Provides usage examples demonstrating convergence
- Follows PEP8 coding standards
- Part of issue #13662

* updating DIRECTORY.md

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-12 00:14:49 +02:00
Umang Dadhichpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>umang-dadhichChristian Clauss
43cb26cb3d Fix formatting and grammar in CONTRIBUTING.md 🍉 (#12894)
* Fix formatting and grammar in CONTRIBUTING.md 🍉

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* commited

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Warp long line 72 to placate rumdl in pre-commit

CONTRIBUTING.md:72:351: [MD013] Line length 376 exceeds 350 characters

* Revise pre-commit instructions and docstring guidelines

Updated the CONTRIBUTING.md file to clarify pre-commit plugin usage and improve docstring requirements.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Improve comments guidelines in CONTRIBUTING.md

Reorganize comments on code explanation for clarity.

* Update forward propagation reference link

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: umang-dadhich <umang-dadhich@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-10 15:49:18 +02:00
BHUMIKA KADU✨kadubhumikapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
636dd57af7 Fix ty invalid assignment (#15222)
* Fix ty invalid assignment diagnostics

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix unused typing import

* Fix gradient accumulation type handling

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix automatic differentiation gradient dtype handling

---------

Co-authored-by: kadubhumika <kadubhumika@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-08 17:57:46 +02:00
priya-sundaram-dev 35b7074d2d Re-enable five disabled algorithms and the perceptron (#15208)
Re-enable the four scikit-learn machine-learning examples and the
neural-network perceptron that had been disabled (renamed to
.broken.txt / .DISABLED), and modernize them so they import and run
cleanly on current scikit-learn and pass the doctest CI:

machine_learning/gaussian_naive_bayes.py
machine_learning/random_forest_classifier.py
  - Replace the removed sklearn.metrics.plot_confusion_matrix with
    ConfusionMatrixDisplay.from_estimator (removed in scikit-learn 1.2).
  - Drop the artificial time.sleep() calls.

machine_learning/gradient_boosting_regressor.py
machine_learning/random_forest_regressor.py
  - Replace the removed load_boston dataset (removed in scikit-learn
    1.2 for ethical reasons) with the bundled load_diabetes dataset so
    the examples run offline.
  - Avoid an unused-variable lint (RUF059).

neural_network/perceptron.py
  - Use a dedicated seeded random.Random instance instead of the global
    random state, so training is reproducible and thread-safe under the
    parallel test runner.
  - Cap training at epoch_number epochs so it always terminates even on
    non-linearly-separable data (previously an unbounded while True).
  - Have training() and sort() return their results instead of printing,
    per the contribution guidelines, and update the doctests accordingly.

Requested by @cclauss in #8029; perceptron follow-up to #15206.
2026-09-06 18:52:09 +02:00
Christian Claussandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 63180d7e24 pre-commit autoupdate 2025-09-11 (#12963)
* pre-commit autoupdate 2025-09-11

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-13 01:56:14 +03:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
4fe50bc1fc [pre-commit.ci] pre-commit autoupdate -- ruff 2025 stable format (#12521)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/dual_number_automatic_differentiation.py

* Update maths/dual_number_automatic_differentiation.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dual_number_automatic_differentiation.py

* Update dual_number_automatic_differentiation.py

* No <fin-streamer> tag with the specified data-test attribute found.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2025-01-13 21:52:12 +01:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> fc33c50593 [pre-commit.ci] pre-commit autoupdate (#12398)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.0)
- [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-25 21:46:20 +01:00
Christian Clauss 0177ae1cd5 Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
1cfca52db7 chore: fix typos (#11467)
* chore: fix typos

Signed-off-by: snoppy <michaleli@foxmail.com>

* Apply suggestions from code review

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

---------

Signed-off-by: snoppy <michaleli@foxmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-06-17 06:27:07 -07:00
Maxim Smolskiy 2d6be5fbb0 Enable ruff UP031 rule (#11388) 2024-04-30 06:40:26 +02:00
Maxim SmolskiyandChristian Clauss 4700297b3e Enable ruff RUF002 rule (#11377)
* Enable ruff RUF002 rule

* Fix

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2024-04-22 21:51:47 +02:00
Maxim Smolskiy f437f92279 Enable ruff INP001 rule (#11346)
* Enable ruff INP001 rule

* Fix

* Fix

* Fix

* Fix

* Fix
2024-04-02 21:13:56 +02:00
Maxim Smolskiy f8a948914b Enable ruff NPY002 rule (#11336) 2024-04-01 21:39:31 +02:00
Maxim Smolskiyandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> f2246ce7fd Enable ruff ICN001 rule (#11329)
* Enable ruff ICN001 rule

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-28 18:03:23 +00:00
Maxim SmolskiyandMaximSmolskiy da47d5c88c Enable ruff N999 rule (#11331)
* Enable ruff N999 rule

* updating DIRECTORY.md

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
2024-03-28 18:26:41 +01:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> bc8df6de31 [pre-commit.ci] pre-commit autoupdate (#11322)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-13 07:52:41 +01:00
Maxim SmolskiyMaximSmolskiypre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
fd27953d44 Reenable files when TensorFlow supports the current Python (#11318)
* Remove python_version < '3.12' for tensorflow

* Reenable dynamic_programming/k_means_clustering_tensorflow.py

* updating DIRECTORY.md

* Try to fix ruff

* Try to fix ruff

* Try to fix ruff

* Try to fix ruff

* Try to fix ruff

* Reenable machine_learning/lstm/lstm_prediction.py

* updating DIRECTORY.md

* Try to fix ruff

* Reenable computer_vision/cnn_classification.py

* updating DIRECTORY.md

* Reenable neural_network/input_data.py

* updating DIRECTORY.md

* Try to fix ruff

* Try to fix ruff

* Try to fix mypy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix ruff

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-12 09:35:49 +01:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
ed8d9209da [pre-commit.ci] pre-commit autoupdate (#11275)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.0)

* Upgrade pyproject.toml

* Revert sudoku_solver.py RUF017 Avoid quadratic list summation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2024-02-05 20:48:10 +01:00
Param Thakkarandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 51c5c87b9a File moved to neural_network/activation_functions (#11216)
* added GELU activation functions file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_error_linear_unit.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update gaussian_error_linear_unit.py

* Delete neural_network/activation_functions/gaussian_error_linear_unit.py

* Rename maths/gaussian_error_linear_unit.py to neural_network/activation_functions/gaussian_error_linear_unit.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-27 03:35:29 -05:00
Tapas Singhalpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
aa5c97d72c Create ipv4_conversion.py (#11008)
* Create ipconversion.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update conversions/ipconversion.py

* Update ipconversion.py

* Rename ipconversion.py to ipv4_conversion.py

* forward_propagation(32, 450_000)  # Was 10_000_000

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 00:47:46 +02:00
Barun Paruapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
d9562033f6 added a function to calculate perceived frequency by observer using Doppler Effect (#10776)
* avg and mps speed formulae added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* avg and mps speed formulae added

* fixed_spacing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* spacing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* ws

* added amicable numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added amicable numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* spacing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed

* changed name of file and added code improvements

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* issues fixed due to pi

* requested changes added

* Created doppler_effect_of_sound.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated doppler_effect_of_sound.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added desc names

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed spacing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* renamed doppler_effect_of_sound.py to doppler_frequency.py

* used expection handling rather than print statements

* fixed spacing for ruff

* Update doppler_frequency.py

This is super slick!  Well done.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-22 00:33:50 +02:00
Shivansh BhatnagarShivansh Bhatnagarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
572de4f15e Added A General Swish Activation Function inNeural Networks (#10415)
* Added A General Swish Activation Function inNeural Networks

* Added the general swish function in the SiLU function and renamed it as swish.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Shivansh Bhatnagar <shivansh.bhatnagar.mat22@iitbhu.ac.in>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-18 10:50:18 -04:00
Tianyi Zhengandgithub-actions b6b45eb1ce Fix numpy deprecation warning in 2_hidden_layers_neural_network.py (#10424)
* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Fix deprecation warning in 2_hidden_layers_neural_network.py

Fix numpy deprecation warning:
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-16 01:41:45 +02:00
Saahil Mahatopre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Tianyi Zheng
ed19b1cf0c Add binary step activation function (#10030)
* Add binary step activation function

* fix: ruff line too long error

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: add link to directory

* revert: add link to directory

* fix: algorithm bug and docs

* Update neural_network/activation_functions/binary_step.py

* fix: ruff line too long error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-08 19:34:50 -04:00
Saahil Mahatopre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Tianyi Zheng
2260961a80 Add Soboleva Modified Hyberbolic Tangent function (#10043)
* Add Sobovela Modified Hyberbolic Tangent function

* fix: typo

* Update and rename sobovela_modified_hyperbolic_tangent.py to soboleva_modified_hyperbolic_tangent.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: typo

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-08 19:19:28 -04:00
Kausthub KannanandTianyi Zheng a12b07f352 Added Squareplus Activation Function (#9977)
* Added Squareplus Activation Function

* Added parameter beta to the function

* Fixed Squareplus Function

* Update neural_network/activation_functions/squareplus.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-08 12:08:37 -04:00
Kausthub Kannan 08d394126c Changed Mish Activation Function to use Softplus (#10111) 2023-10-08 11:48:22 -04:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>github-actionsTianyi ZhengChristian Clauss
895dffb412 [pre-commit.ci] pre-commit autoupdate (#9543)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292)
- [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6)
- [github.com/tox-dev/pyproject-fmt: 1.1.0 → 1.2.0](https://github.com/tox-dev/pyproject-fmt/compare/1.1.0...1.2.0)

* updating DIRECTORY.md

* Fix typos in test_min_spanning_tree_prim.py

* Fix typos

* codespell --ignore-words-list=manuel

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-07 21:32:28 +02:00
Kausthub Kannan 80a2087e0a Added Softplus activation function (#9944) 2023-10-06 16:26:09 -04:00
Kausthub KannanandTianyi Zheng c6ec99d571 Added Mish Activation Function (#9942)
* Added Mish Activation Function

* Apply suggestions from code review

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-06 15:23:05 -04:00
AasheeshandTianyi Zheng deb0480b3a Changing the directory of sigmoid_linear_unit.py (#9824)
* Changing the directory of sigmoid_linear_unit.py

* Delete neural_network/activation_functions/__init__.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-05 10:07:44 -04:00
piyush-poddar 26d650ec28 Moved relu.py from maths/ to neural_network/activation_functions (#9753)
* Moved file relu.py from maths/ to neural_network/activation_functions

* Renamed relu.py to rectified_linear_unit.py

* Renamed relu.py to rectified_linear_unit.py in DIRECTORY.md
2023-10-04 16:28:19 -04:00
Adarsh Acharyaandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 153c35eac0 Added Scaled Exponential Linear Unit Activation Function (#9027)
* Added Scaled Exponential Linear Unit Activation Function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update scaled_exponential_linear_unit.py

* Update scaled_exponential_linear_unit.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update scaled_exponential_linear_unit.py

* Update scaled_exponential_linear_unit.py

* Update scaled_exponential_linear_unit.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update scaled_exponential_linear_unit.py

* Update scaled_exponential_linear_unit.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-06 15:16:51 -04:00
Kotminpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Tianyi Zheng
5a4ea233cd Style sigmoid function in harmony with pep guideness (#6677)
* Style sigmoid function in harmony with pep guideness

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-09-04 13:38:26 -04:00
Kausthub Kannan f6b12420ce Added Leaky ReLU Activation Function (#8962)
* Added Leaky ReLU activation function

* Added Leaky ReLU activation function

* Added Leaky ReLU activation function

* Formatting and spelling fixes done
2023-08-16 18:22:15 -07:00
Tianyi Zhengandgithub-actions ae0fc85401 Fix ruff errors (#8936)
* Fix ruff errors

Renamed neural_network/input_data.py to neural_network/input_data.py_tf
because it should be left out of the directory for the following
reasons:

1. Its sole purpose is to be used by neural_network/gan.py_tf, which is
   itself left out of the directory because of issues with TensorFlow.

2. It was taken directly from TensorFlow's codebase and is actually
   already deprecated. If/when neural_network/gan.py_tf is eventually
   re-added back to the directory, its implementation should be changed
   to not use neural_network/input_data.py anyway.

* updating DIRECTORY.md

* Change input_data.py_tf file extension

Change input_data.py_tf file extension because algorithms-keeper bot is being picky about it

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-09 13:25:30 +05:30
Christian Clauss dbaff34572 Fix ruff rules ISC flake8-implicit-str-concat (#8892) 2023-07-28 17:53:09 +01:00
Christian ClaussDhruv Manilawalapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
4b79d771cd Add more ruff rules (#8767)
* Add more ruff rules

* Add more ruff rules

* pre-commit: Update ruff v0.0.269 -> v0.0.270

* Apply suggestions from code review

* Fix doctest

* Fix doctest (ignore whitespace)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-26 09:34:17 +02:00
Dipankar MitraChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
7310514509 The ELU activation is added (#8699)
* tanh function been added

* tanh function been added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tanh function is added

* tanh function is added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tanh function added

* tanh function added

* tanh function is added

* Apply suggestions from code review

* ELU activation function is added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* elu activation is added

* ELU activation is added

* Update maths/elu_activation.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Exponential_linear_unit activation is added

* Exponential_linear_unit activation is added

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-05-02 16:36:28 +02:00
Maxim Smolskiygithub-actionspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
56a40eb3ee Reenable files when TensorFlow supports the current Python (#8602)
* Remove python_version < "3.11" for tensorflow

* Reenable neural_network/input_data.py_tf

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix ruff

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix ruff

* Try to fix ruff

* Try to fix ruff

* Try to fix pre-commit

* Try to fix

* Fix

* Fix

* Reenable dynamic_programming/k_means_clustering_tensorflow.py_tf

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to fix ruff

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-01 19:43:11 +02:00
GenesisandChristian Clauss 7cdb011ba4 New gitter link added or replaced (#8551)
* New gitter link added

* ruff==0.0.258

* noqa: S310

* noqa: S310

* Update ruff.yml

* Add Ruff rule S311

* Ruff v0.0.259

* return ("{:08x}" * 5).format(*self.h)

* pickle.load(f)  # noqa: S301

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-03-26 17:19:18 +02:00