





import math
import random

def       A__(		__lowerCAmelCase	,			__lowerCAmelCase = False ):
				if deriv:
								return value * (1 - value)
				return 1 / (1 + math.exp(-value ))


# Initial Value
lowercase_		:				Union[str, Any]				=						0.02

def       A__(		__lowerCAmelCase	,			__lowerCAmelCase ):
				_snake_case :			List[Any]  						=   float(2 * (random.randint(1	,			1_00 )) - 1 )

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

				return layer_a * 1_00


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		lowercase_		:				Tuple				=						int(input('''Expected value: '''))
		lowercase_		:				List[str]				=						int(input('''Number of propagations: '''))
		print(forward_propagation(expected, number_propagations))













def       A__(		__lowerCAmelCase ):

				if not isinstance(__lowerCAmelCase	,			__lowerCAmelCase ):
								raise TypeError('only integers accepted as input' )
				else:
								_snake_case :			Any  						=   str(abs(__lowerCAmelCase ) )
								_snake_case :			List[str]  						=   [list(__lowerCAmelCase ) for char in range(len(__lowerCAmelCase ) )]
								for index in range(len(__lowerCAmelCase ) ):
												num_transpositions[index].pop(__lowerCAmelCase )
								return max(
								    int(''.join(list(__lowerCAmelCase ) ) ) for transposition in num_transpositions )


if __name__ == "__main__":
		__import__('''doctest''').testmod()






