From 57c327603777764e822cd54063496a63798f3a9c Mon Sep 17 00:00:00 2001 From: Manoj Routhu <78267609+Manoj-Routhu@users.noreply.github.com> Date: Sat, 14 Oct 2023 19:47:35 +0530 Subject: [PATCH] Update simple_neural_network.py --- neural_network/simple_neural_network.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/neural_network/simple_neural_network.py b/neural_network/simple_neural_network.py index 9fc085ab2b0f..fcc661fc6f88 100644 --- a/neural_network/simple_neural_network.py +++ b/neural_network/simple_neural_network.py @@ -21,15 +21,12 @@ def sigmoid_function(value: float, deriv: bool = False) -> float: return 1 / (1 + math.exp(-value)) +def elementwise_multiply(value, array): + return [value * x for x in array] + # Initial Value INITIAL_VALUE = 0.02 - -def forward_propagation(expected, number_propagations): - # Random weight initialization - weight = 2 * (random.random() - 0.5) - - def forward_propagation(expected: int, number_propagations: int) -> float: """Return the value found after the forward propagation training.