From 1b31c25fc39da62da114a7502006a22a70da02f1 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 27 Oct 2023 00:02:24 +0200 Subject: [PATCH 1/9] simple_neural_network.py: Fewer forward propogations to speed tests Closes #9718 --- neural_network/simple_neural_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neural_network/simple_neural_network.py b/neural_network/simple_neural_network.py index f2a3234873b5..b35aae396900 100644 --- a/neural_network/simple_neural_network.py +++ b/neural_network/simple_neural_network.py @@ -28,7 +28,7 @@ def sigmoid_function(value: float, deriv: bool = False) -> float: def forward_propagation(expected: int, number_propagations: int) -> float: """Return the value found after the forward propagation training. - >>> res = forward_propagation(32, 10000000) + >>> res = forward_propagation(32, 100_000) # Was 10_000_000 >>> res > 31 and res < 33 True From 68375423417865bc2d90a3bc347b1c81b3036fe0 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Thu, 26 Oct 2023 22:02:37 +0000 Subject: [PATCH 2/9] updating DIRECTORY.md --- DIRECTORY.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index d108acf8dcfb..bfda1282148c 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -170,6 +170,8 @@ * Arrays * [Equilibrium Index In Array](data_structures/arrays/equilibrium_index_in_array.py) * [Find Triplets With 0 Sum](data_structures/arrays/find_triplets_with_0_sum.py) + * [Index 2D Array In 1D](data_structures/arrays/index_2d_array_in_1d.py) + * [Kth Largest Element](data_structures/arrays/kth_largest_element.py) * [Median Two Array](data_structures/arrays/median_two_array.py) * [Pairs With Given Sum](data_structures/arrays/pairs_with_given_sum.py) * [Permutations](data_structures/arrays/permutations.py) @@ -368,6 +370,7 @@ ## Electronics * [Apparent Power](electronics/apparent_power.py) * [Builtin Voltage](electronics/builtin_voltage.py) + * [Capacitor Equivalence](electronics/capacitor_equivalence.py) * [Carrier Concentration](electronics/carrier_concentration.py) * [Charging Capacitor](electronics/charging_capacitor.py) * [Charging Inductor](electronics/charging_inductor.py) @@ -648,6 +651,7 @@ * [Numerical Integration](maths/numerical_analysis/numerical_integration.py) * [Runge Kutta](maths/numerical_analysis/runge_kutta.py) * [Runge Kutta Fehlberg 45](maths/numerical_analysis/runge_kutta_fehlberg_45.py) + * [Runge Kutta Gills](maths/numerical_analysis/runge_kutta_gills.py) * [Secant Method](maths/numerical_analysis/secant_method.py) * [Simpson Rule](maths/numerical_analysis/simpson_rule.py) * [Square Root](maths/numerical_analysis/square_root.py) @@ -814,6 +818,7 @@ * [Ideal Gas Law](physics/ideal_gas_law.py) * [In Static Equilibrium](physics/in_static_equilibrium.py) * [Kinetic Energy](physics/kinetic_energy.py) + * [Lens Formulae](physics/lens_formulae.py) * [Lorentz Transformation Four Vector](physics/lorentz_transformation_four_vector.py) * [Malus Law](physics/malus_law.py) * [Mass Energy Equivalence](physics/mass_energy_equivalence.py) From ed4ec69c7684018ffd25eb5c9235e6dc56fb46e4 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 27 Oct 2023 13:16:22 +0200 Subject: [PATCH 3/9] forward_propagation(32, 1_000_000) # Was 10_000_000 --- neural_network/simple_neural_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neural_network/simple_neural_network.py b/neural_network/simple_neural_network.py index b35aae396900..0a0afcb9ff0b 100644 --- a/neural_network/simple_neural_network.py +++ b/neural_network/simple_neural_network.py @@ -28,7 +28,7 @@ def sigmoid_function(value: float, deriv: bool = False) -> float: def forward_propagation(expected: int, number_propagations: int) -> float: """Return the value found after the forward propagation training. - >>> res = forward_propagation(32, 100_000) # Was 10_000_000 + >>> res = forward_propagation(32, 1_000_000) # Was 10_000_000 >>> res > 31 and res < 33 True From dc7448d59f10a15cfc84951c6abc27c0a66ef813 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 27 Oct 2023 14:11:29 +0200 Subject: [PATCH 4/9] forward_propagation(32, 500_000) # Was 10_000_000 --- neural_network/simple_neural_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neural_network/simple_neural_network.py b/neural_network/simple_neural_network.py index 0a0afcb9ff0b..892d4dbfd83d 100644 --- a/neural_network/simple_neural_network.py +++ b/neural_network/simple_neural_network.py @@ -28,7 +28,7 @@ def sigmoid_function(value: float, deriv: bool = False) -> float: def forward_propagation(expected: int, number_propagations: int) -> float: """Return the value found after the forward propagation training. - >>> res = forward_propagation(32, 1_000_000) # Was 10_000_000 + >>> res = forward_propagation(32, 500_000) # Was 10_000_000 >>> res > 31 and res < 33 True From 8668f5792dc673f085966f6f90c9c896081f22e9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 27 Oct 2023 23:19:24 +0200 Subject: [PATCH 5/9] Update simple_neural_network.py --- neural_network/simple_neural_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neural_network/simple_neural_network.py b/neural_network/simple_neural_network.py index 892d4dbfd83d..8751a38908cf 100644 --- a/neural_network/simple_neural_network.py +++ b/neural_network/simple_neural_network.py @@ -28,7 +28,7 @@ def sigmoid_function(value: float, deriv: bool = False) -> float: def forward_propagation(expected: int, number_propagations: int) -> float: """Return the value found after the forward propagation training. - >>> res = forward_propagation(32, 500_000) # Was 10_000_000 + >>> res = forward_propagation(32, 450_000) # Was 10_000_000 >>> res > 31 and res < 33 True From d9038fd6996c0408a0af3b18032fe6d87ff56852 Mon Sep 17 00:00:00 2001 From: MayureshMore Date: Thu, 13 Feb 2025 09:20:41 -0800 Subject: [PATCH 6/9] [Edited] Fix minor bug in the main function --- project_euler/problem_039/sol1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project_euler/problem_039/sol1.py b/project_euler/problem_039/sol1.py index c8ffa8934159..174b7e77a49b 100644 --- a/project_euler/problem_039/sol1.py +++ b/project_euler/problem_039/sol1.py @@ -53,3 +53,5 @@ def solution(n: int = 1000) -> int: if __name__ == "__main__": print(f"Perimeter {solution()} has maximum solutions") + +# Automated edit: [Edited] Fix minor bug in the main function From 7d069c15b9028347da5310ba5b53e7502da3c9a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 17:21:25 +0000 Subject: [PATCH 7/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- project_euler/problem_039/sol1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project_euler/problem_039/sol1.py b/project_euler/problem_039/sol1.py index 174b7e77a49b..9918db7d8c9d 100644 --- a/project_euler/problem_039/sol1.py +++ b/project_euler/problem_039/sol1.py @@ -53,5 +53,5 @@ def solution(n: int = 1000) -> int: if __name__ == "__main__": print(f"Perimeter {solution()} has maximum solutions") - -# Automated edit: [Edited] Fix minor bug in the main function + +# Automated edit: [Edited] Fix minor bug in the main function From d81f1b2f767e576f3eda98b99c830dad7fe904ce Mon Sep 17 00:00:00 2001 From: MayureshMore Date: Thu, 13 Feb 2025 12:09:58 -0800 Subject: [PATCH 8/9] [Edited] Fix minor bug in the main function --- project_euler/problem_045/sol1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project_euler/problem_045/sol1.py b/project_euler/problem_045/sol1.py index d921b2802c2d..65ecd4dd083e 100644 --- a/project_euler/problem_045/sol1.py +++ b/project_euler/problem_045/sol1.py @@ -57,3 +57,5 @@ def solution(start: int = 144) -> int: if __name__ == "__main__": print(f"{solution()} = ") + +# Local fallback improvement: appended a small comment. From 69c994afe2273e2e799f93305d17c1c3c13d787c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 20:11:00 +0000 Subject: [PATCH 9/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- project_euler/problem_045/sol1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project_euler/problem_045/sol1.py b/project_euler/problem_045/sol1.py index 65ecd4dd083e..ec199ceb934d 100644 --- a/project_euler/problem_045/sol1.py +++ b/project_euler/problem_045/sol1.py @@ -57,5 +57,5 @@ def solution(start: int = 144) -> int: if __name__ == "__main__": print(f"{solution()} = ") - -# Local fallback improvement: appended a small comment. + +# Local fallback improvement: appended a small comment.