





import math
import random


def     lowerCamelCase_	(      lowerCAmelCase:	int    ,							lowerCAmelCase:	Tuple = False				)->		float:
  if deriv:
    return value * (1 - value)
  return 1 / (1 + math.exp(-value				))


# Initial Value
lowerCAmelCase_						   =    0.02


def     lowerCamelCase_	(      lowerCAmelCase:	List[Any]    ,							lowerCAmelCase:	Optional[int]				)->		float:
  _snake_case   :				int														=	float(2 * (random.randint(1    ,							1_00				)) - 1				)

  for _ in range(__UpperCamelCase				):
    # Forward propagation
    _snake_case   :				List[str]														=	sigmoid_function(INITIAL_VALUE * weight				)
    # How much did we miss?
    _snake_case   :				Tuple														=	(expected / 1_00) - layer_a
    # Error delta
    _snake_case   :				str														=	layer_1_error * sigmoid_function(__UpperCamelCase    ,							__UpperCamelCase				)
    # Update weight
    weight += INITIAL_VALUE * layer_1_delta

  return layer_a * 1_00


if __name__ == "__main__":
       import doctest

       doctest.testmod()

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











import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union



@dataclass
class        _lowerCAmelCase    :


  '''simple docstring'''
  a_							:       Optional[Union[str, Path]]      					=None
  a_							:       bool      					=False
  a_							:       bool      					=False
  a_							:       bool      					=False
  a_							:       Optional[Dict]      					=None
  a_							:       Optional[str]      					=None
  a_							:       bool      					=False
  a_							:       bool      					=False
  a_							:       bool      					=False
  a_							:       bool      					=True
  a_							:       Optional[int]      					=None
  a_							:       int      					=1
  a_							:       Optional[Union[str, bool]]      					=None
  a_							:       bool      					=False
  a_							:       Optional[Dict]      					=None
  a_							:       Optional[str]      					=None







  def UpperCamelCase_ (      self      :					Dict							):


    '''simple docstring'''





    return self.__class__(**{k: copy.deepcopy(UpperCamelCase							) for k, v in self.__dict__.items()}							)




