import math
import random




def       lowerCAmelCase_     (		lowercase:							float  ,					lowercase:							bool = False		)    ->				float:







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


# Initial Value
UpperCAmelCase_			    =							0.0_2




def       lowerCAmelCase_     (		lowercase:							int  ,					lowercase:							int		)    ->				float:







 '''simple docstring'''
 _UpperCamelCase:     Dict							= float(2 * (random.randint(1  ,					100		)) - 1		)

 for _ in range(lowercase		):
  # Forward propagation
  _UpperCamelCase:     int							= sigmoid_function(INITIAL_VALUE * weight		)
  # How much did we miss?
  _UpperCamelCase:     List[str]							= (expected / 100) - layer_a
  # Error delta
  _UpperCamelCase:     Optional[Any]							= layer_1_error * sigmoid_function(lowercase  ,					lowercase		)
  # 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))
from __future__ import annotations




class  __magic_name__  :





   """simple docstring"""




   def __init__(	self					:  Any		,  _lowercase					:  Dict=None							):



    """simple docstring"""



    _UpperCamelCase:     Tuple							= data
    _UpperCamelCase:     int							= None



   def __repr__(	self					:  Dict							):



    """simple docstring"""



    _UpperCamelCase:     int							= []
    _UpperCamelCase:     str							= self
    while temp:
     string_rep.append(f"""{temp.data}"""							)
     _UpperCamelCase:     Optional[Any]							= temp.next
    return "->".join(_lowercase							)




def       lowerCAmelCase_     (		lowercase:							list		)    ->				Optional[int]:







 '''simple docstring'''
 if not elements_list:
  raise Exception('''The Elements List is empty'''		)

 _UpperCamelCase:     Optional[Any]							= Node(elements_list[0]		)
 for i in range(1  ,					len(lowercase		)		):
  _UpperCamelCase:     Union[str, Any]							= Node(elements_list[i]		)
  _UpperCamelCase:     Optional[int]							= current.next
 return head




def       lowerCAmelCase_     (		lowercase:							Node		)    ->				None:







 '''simple docstring'''
 if head_node is not None and isinstance(lowercase  ,					lowercase		):
  print_reverse(head_node.next		)
  print(head_node.data		)




def       lowerCAmelCase_     (		)    ->				Tuple:







 '''simple docstring'''
 from doctest import testmod

 testmod()

 _UpperCamelCase:     Any							= make_linked_list([14, 52, 14, 12, 43]		)
 print('''Linked List:'''		)
 print(lowercase		)
 print('''Elements in Reverse:'''		)
 print_reverse(lowercase		)


if __name__ == "__main__":
  main()