

import math
import random





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__ = False				):







							'''simple docstring'''






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


# Initial Value
_UpperCAmelCase		:       Optional[int]						    =	0.02





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






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

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

							return layer_a * 100


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					_UpperCAmelCase		:       int						    =	int(input("""Expected value: """))
					_UpperCAmelCase		:       Union[str, Any]						    =	int(input("""Number of propagations: """))
					print(forward_propagation(expected, number_propagations))







from __future__ import annotations





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__ = None       ,							UpperCamelCase__ = None				):







							'''simple docstring'''






							if start is None:
														snake_case_          =   0

							if end is None:
														snake_case_          =   len(UpperCamelCase__				) - 1

							if start >= end:
														return

							snake_case_          =   (start + end) // 2

							slowsort(UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__				)
							slowsort(UpperCamelCase__       ,							mid + 1       ,							UpperCamelCase__				)

							if sequence[end] < sequence[mid]:
														snake_case_    ,   snake_case_          =   sequence[mid], sequence[end]

							slowsort(UpperCamelCase__       ,							UpperCamelCase__       ,							end - 1				)


if __name__ == "__main__":
					from doctest import testmod

					testmod()




