"""simple docstring"""







import math
import random
def 						__UpperCAmelCase       (					UpperCAmelCase_					:       float    ,							UpperCAmelCase_					:       bool = False						)							->    float:

	'''simple docstring'''





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


# Initial Value
_a  :  Tuple=				0.0_2
def 						__UpperCAmelCase       (					UpperCAmelCase_					:       int    ,							UpperCAmelCase_					:       int						)							->    float:

	'''simple docstring'''





	__snake_case    :							Union[str, Any]   	=				float(2 * (random.randint(1    ,							1_00						)) - 1						)

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

	return layer_a * 1_00


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	_a  :  Dict=				int(input("Expected value: "))
	_a  :  List[Any]=				int(input("Number of propagations: "))
	print(forward_propagation(expected, number_propagations))






"""simple docstring"""







import numpy as np
def 						__UpperCAmelCase       (					UpperCAmelCase_					:       np.array						)							->    np.array:

	'''simple docstring'''





	return 1 / (1 + np.exp(-vector						))


if __name__ == "__main__":
	import doctest

	doctest.testmod()





