

import math



class     _a						:


					'''simple docstring'''






					def   __A			( self    ,       A__    ,       A__			):
						A__							:    Union[str, Any]        =		0.0
						A__							:    List[str]        =		0.0
						for i in range(len(A__			)			):
							da += math.pow((sample[i] - weights[0][i])    ,       2			)
							da += math.pow((sample[i] - weights[1][i])    ,       2			)
							return 0 if da > da else 1
						return 0






					def   __A			( self    ,       A__    ,       A__    ,       A__    ,       A__			):
						for i in range(len(A__			)			):
							weights[j][i] += alpha * (sample[i] - weights[j][i])
						return weights



def 						UpperCamelCase					()     ->      None:
	# Training Examples ( m, n )
	A__							:    str        =		[[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

	# weight initialization ( n, C )
	A__							:    List[str]        =		[[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

	# training
	A__							:    Union[str, Any]        =		SelfOrganizingMap()
	A__							:    Optional[Any]        =		3
	A__							:    Union[str, Any]        =		0.5

	for _ in range(lowercase_					):
		for j in range(len(lowercase_					)					):
			# training sample
			A__							:    Optional[int]        =		training_samples[j]

			# Compute the winning vector
			A__							:    Optional[int]        =		self_organizing_map.get_winner(lowercase_    ,      lowercase_					)

			# Update the winning vector
			A__							:    Optional[Any]        =		self_organizing_map.update(lowercase_    ,      lowercase_    ,      lowercase_    ,      lowercase_					)

    # classify test sample
	A__							:    Any        =		[0, 0, 0, 1]
	A__							:    List[str]        =		self_organizing_map.get_winner(lowercase_    ,      lowercase_					)

	# results
	print(f"""Clusters that the test sample belongs to : {winner}"""					)
	print(f"""Weights that have been trained : {weights}"""					)


# running the main() function
if __name__ == "__main__":
	main()






def 						UpperCamelCase					(lowercase_: int = 10					)     ->      str:
	if not isinstance(lowercase_    ,      lowercase_					) or n < 0:
		raise ValueError("""Invalid input"""					)
	A__							:    List[str]        =		10**n
	A__							:    Any        =		28433 * (pow(2    ,      7830457    ,      lowercase_					)) + 1
	return str(number % modulus					)


if __name__ == "__main__":
	from doctest import testmod

	testmod()
	print(f'''{solution(10) = }''')



