

import math

class 					a__						:
			"""simple docstring"""







			def      UpperCamelCase		(    self      ,      lowercase      ,      lowercase       )  ->						Union[str, Any]:
							'''simple docstring'''






							A__        =			0.0
							A__        =			0.0
							for i in range(len(UpperCamelCase_       )       ):
											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      UpperCamelCase		(    self      ,      lowercase      ,      lowercase      ,      lowercase      ,      lowercase       )  ->						str:
							'''simple docstring'''






							for i in range(len(UpperCamelCase_       )       ):
											weights[j][i] += alpha * (sample[i] - weights[j][i])
							return weights



def 					lowerCAmelCase__							(	)			->      None:




				'''simple docstring'''





				A__        =			[[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

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

				# training
				A__        =			SelfOrganizingMap()
				A__        =			3
				A__        =			0.5

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

												# Compute the winning vector
												A__        =			self_organizing_map.get_winner(lowerCamelCase__	,       lowerCamelCase__      )

												# Update the winning vector
												A__        =			self_organizing_map.update(lowerCamelCase__	,       lowerCamelCase__	,       lowerCamelCase__	,       lowerCamelCase__      )

    # classify test sample
				A__        =			[0, 0, 0, 1]
				A__        =			self_organizing_map.get_winner(lowerCamelCase__	,       lowerCamelCase__      )

				# 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()




import warnings

from ...utils import logging
from .image_processing_clip import CLIPImageProcessor


lowerCAmelCase__	   = logging.get_logger(__name__)

class 					a__						(					snake_case			):
			"""simple docstring"""







			def __init__(    self      ,      *lowercase      ,      **lowercase       )  ->						None:
							'''simple docstring'''






							warnings.warn(
							    "The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"
							    " use CLIPImageProcessor instead."      ,      lowercase      ,      )
							super().__init__(*lowercase      ,      **lowercase       )

