





"""simple docstring"""





from collections import deque

from .hash_table import HashTable





class 				_lowerCamelCase					(				UpperCAmelCase_       ):


						def __init__(self      ,							*__a      ,							**__a						)       ->      int:
								super().__init__(*__UpperCAmelCase      ,							**__UpperCAmelCase						)


						def 			snake_case_      (self      ,							__a      ,							__a						)       ->      str:
								UpperCamelCase      =		deque([]						) if self.values[key] is None else self.values[key]
								self.values[key].appendleft(__UpperCAmelCase						)
								UpperCamelCase      =		self.values[key]


						def 			snake_case_      (self						)       ->      List[Any]:
								return (
								    sum(self.charge_factor - len(__UpperCAmelCase						) for slot in self.values						)
								    / self.size_table
								    * self.charge_factor
								)




						def 			snake_case_      (self      ,							__a      ,							__a=None						)       ->      Optional[int]:



								if not (
								    len(self.values[key]						) == self.charge_factor and self.values.count(__UpperCAmelCase						) == 0
								):
										return key
								return super()._collision_resolution(__UpperCAmelCase      ,							__UpperCAmelCase						)







import math
import random




def    lowerCAmelCase_ (     __A,  __A = False							)     ->				float:







      '''simple docstring'''


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


# Initial Value
UpperCamelCase__											=					0.0_2




def    lowerCAmelCase_ (     __A,  __A							)     ->				float:







      '''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()

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



