






import math
import random




def      lowercase__      (     __snake_case    :							float     ,       __snake_case    :							bool = False  ):


					'''simple docstring'''


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


# Initial Value
__UpperCAmelCase								=						0.0_2




def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							int  ):


					'''simple docstring'''


					UpperCAmelCase_    :      str            =						float(2 * (random.randint(1     ,       100  )) - 1  )

					for _ in range(__snake_case  ):
										# Forward propagation
										UpperCAmelCase_    :      str            =						sigmoid_function(INITIAL_VALUE * weight  )
										# How much did we miss?
										UpperCAmelCase_    :      Union[str, Any]            =						(expected / 100) - layer_a
										# Error delta
										UpperCAmelCase_    :      Any            =						layer_1_error * sigmoid_function(__snake_case     ,       __snake_case  )
										# 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 typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase								=						{
    'configuration_time_series_transformer': [
        'TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'TimeSeriesTransformerConfig',
    ],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase								=						[
		    'TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TimeSeriesTransformerForPrediction',
		    'TimeSeriesTransformerModel',
		    'TimeSeriesTransformerPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_time_series_transformer import (
		    TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    TimeSeriesTransformerConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_time_series_transformer import (
				    TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TimeSeriesTransformerForPrediction,
				    TimeSeriesTransformerModel,
				    TimeSeriesTransformerPreTrainedModel,
				)

else:
		import sys

		__UpperCAmelCase								=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






