





'''simple docstring'''




import math
import random





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


# Initial Value
_SCREAMING_SNAKE_CASE							     =			0.02





def 	__lowerCamelCase			(      __lowerCAmelCase       :							int      ,    __lowerCAmelCase       :							int		)		->  float:
   snake_case 						=   float(2 * (random.randint(1      ,    1_00		)) - 1		)

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

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








'''simple docstring'''




from __future__ import annotations

_SCREAMING_SNAKE_CASE							     =			1.6021E-19  # units = C





def 	__lowerCamelCase			(      __lowerCAmelCase       :							float      ,    __lowerCAmelCase       :							float      ,    __lowerCAmelCase       :							float      ,    )		->  tuple[str, float]:
   if (conductivity, electron_conc, mobility).count(0		) != 1:
      raise ValueError("""You cannot supply more or less than 2 values"""		)
   elif conductivity < 0:
      raise ValueError("""Conductivity cannot be negative"""		)
   elif electron_conc < 0:
      raise ValueError("""Electron concentration cannot be negative"""		)
   elif mobility < 0:
      raise ValueError("""mobility cannot be negative"""		)
   elif conductivity == 0:
      return (
          "conductivity",
          mobility * electron_conc * ELECTRON_CHARGE,
      )
   elif electron_conc == 0:
      return (
          "electron_conc",
          conductivity / (mobility * ELECTRON_CHARGE),
      )
   else:
      return (
          "mobility",
          conductivity / (electron_conc * ELECTRON_CHARGE),
      )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

