




"""simple docstring"""







import math
import random





def      __snake_case (				_lowercase			,_lowercase = False    ):


    """simple docstring"""







    if deriv:
        return value * (1 - value)
    return 1 / (1 + math.exp(-value    ))


# Initial Value
SCREAMING_SNAKE_CASE_	     =       0.02





def      __snake_case (				_lowercase			,_lowercase    ):


    """simple docstring"""







    UpperCamelCase              =	float(2 * (random.randint(1			,100    )) - 1    )

    for _ in range(_A    ):
        # Forward propagation
        UpperCamelCase              =	sigmoid_function(INITIAL_VALUE * weight    )
        # How much did we miss?
        UpperCamelCase              =	(expected / 100) - layer_a
        # Error delta
        UpperCamelCase              =	layer_1_error * sigmoid_function(_A			,_A    )
        # Update weight
        weight += INITIAL_VALUE * layer_1_delta

    return layer_a * 100


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  SCREAMING_SNAKE_CASE_	     =       int(input('Expected value: '))
  SCREAMING_SNAKE_CASE_	     =       int(input('Number of propagations: '))
  print(forward_propagation(expected, number_propagations))







"""simple docstring"""







import math
import random


def      UpperCamelCase       ( _A  ,				_A = False )     ->       float:
				if deriv:
								return value * (1 - value)
				return 1 / (1 + math.exp(-value ))


# Initial Value
_lowerCAmelCase            =	0.02


def      UpperCamelCase       ( _A  ,				_A )     ->       float:
				lowercase    :      Any       = float(2 * (random.randint(1  ,				100 )) - 1 )

				for _ in range(_A ):
								# Forward propagation
								lowercase    :      Dict       = sigmoid_function(INITIAL_VALUE * weight )
								# How much did we miss?
								lowercase    :      Any       = (expected / 100) - layer_a
								# Error delta
								lowercase    :      Dict       = layer_1_error * sigmoid_function(_A  ,				_A )
								# Update weight
								weight += INITIAL_VALUE * layer_1_delta

				return layer_a * 100


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				_lowerCAmelCase            =	int(input('Expected value: '))
				_lowerCAmelCase            =	int(input('Number of propagations: '))
				print(forward_propagation(expected, number_propagations))
