



import random


def A						(       __UpperCamelCase ,	__UpperCamelCase ,	__UpperCamelCase = False					)						->      dict:
			A__       =    {i: [] for i in range(__UpperCamelCase					)}

			# if probability is greater or equal than 1, then generate a complete graph
			if probability >= 1:
						return complete_graph(__UpperCamelCase					)
			# if probability is lower or equal than 0, then return a graph without edges
			if probability <= 0:
						return graph

			# for each couple of nodes, add an edge from u to v
			# if the number randomly generated is greater than probability probability
			for i in range(__UpperCamelCase					):
						for j in range(i + 1 ,	__UpperCamelCase					):
									if random.random() < probability:
												graph[i].append(__UpperCamelCase					)
												if not directed:
															# if the graph is undirected, add an edge in from j to i, either
															graph[j].append(__UpperCamelCase					)
			return graph


def A						(       __UpperCamelCase					)						->      dict:
			return {
			    i: [j for j in range(__UpperCamelCase					) if i != j] for i in range(__UpperCamelCase					)
			}


if __name__ == "__main__":
							import doctest

							doctest.testmod()









import math
import random


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


# Initial Value
SCREAMING_SNAKE_CASE__       =      0.02


def A						(       __UpperCamelCase ,	__UpperCamelCase					)						->      float:
			A__       =    float(2 * (random.randint(1 ,	100					)) - 1					)

			for _ in range(__UpperCamelCase					):
						# Forward propagation
						A__       =    sigmoid_function(INITIAL_VALUE * weight					)
						# How much did we miss?
						A__       =    (expected / 100) - layer_a
						# Error delta
						A__       =    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()

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




