





import numpy

class        __SCREAMING_SNAKE_CASE					:






							def __init__(						self  , __lowerCAmelCase  , __lowerCAmelCase  ):
														UpperCamelCase__				     =			input_array

														# Random initial weights are assigned where first argument is the
														# number of nodes in previous layer and second argument is the
														# number of nodes in the next layer.

														# Random initial weights are assigned.
														# self.input_array.shape[1] is used to represent number of nodes in input layer.
														# First hidden layer consists of 4 nodes.
														UpperCamelCase__				     =			numpy.random.rand(
														    self.input_array.shape[1]  , 4  )

														# Random initial values for the first hidden layer.
														# First hidden layer has 4 nodes.
														# Second hidden layer has 3 nodes.
														UpperCamelCase__				     =			numpy.random.rand(
														    4  , 3  )

														# Random initial values for the second hidden layer.
														# Second hidden layer has 3 nodes.
														# Output layer has 1 node.
														UpperCamelCase__				     =			numpy.random.rand(3  , 1  )

														# Real output values provided.
														UpperCamelCase__				     =			output_array

														# Predicted output values by the neural network.
														# Predicted_output array initially consists of zeroes.
														UpperCamelCase__				     =			numpy.zeros(output_array.shape  )






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			sigmoid(
														    numpy.dot(self.input_array  , self.input_layer_and_first_hidden_layer_weights  )  )

														# layer_between_first_hidden_layer_and_second_hidden_layer is the layer
														# connecting the first hidden set of nodes with the second hidden set of nodes.
														UpperCamelCase__				     =			sigmoid(
														    numpy.dot(
														        self.layer_between_input_and_first_hidden_layer  , self.first_hidden_layer_and_second_hidden_layer_weights  , )  )

														# layer_between_second_hidden_layer_and_output is the layer connecting
														# second hidden layer with the output node.
														UpperCamelCase__				     =			sigmoid(
														    numpy.dot(
														        self.layer_between_first_hidden_layer_and_second_hidden_layer  , self.second_hidden_layer_and_output_layer_weights  , )  )

														return self.layer_between_second_hidden_layer_and_output






							def 				_lowerCamelCase		(						self  ):
														UpperCamelCase__				     =			numpy.dot(
														    self.layer_between_first_hidden_layer_and_second_hidden_layer.T  , 2
														    * (self.output_array - self.predicted_output)
														    * sigmoid_derivative(self.predicted_output  )  , )
														UpperCamelCase__				     =			numpy.dot(
														    self.layer_between_input_and_first_hidden_layer.T  , numpy.dot(
														        2
														        * (self.output_array - self.predicted_output)
														        * sigmoid_derivative(self.predicted_output  )  , self.second_hidden_layer_and_output_layer_weights.T  , )
														    * sigmoid_derivative(
														        self.layer_between_first_hidden_layer_and_second_hidden_layer  )  , )
														UpperCamelCase__				     =			numpy.dot(
														    self.input_array.T  , numpy.dot(
														        numpy.dot(
														            2
														            * (self.output_array - self.predicted_output)
														            * sigmoid_derivative(self.predicted_output  )  , self.second_hidden_layer_and_output_layer_weights.T  , )
														        * sigmoid_derivative(
														            self.layer_between_first_hidden_layer_and_second_hidden_layer  )  , self.first_hidden_layer_and_second_hidden_layer_weights.T  , )
														    * sigmoid_derivative(self.layer_between_input_and_first_hidden_layer  )  , )

														self.input_layer_and_first_hidden_layer_weights += (
														    updated_input_layer_and_first_hidden_layer_weights
														)
														self.first_hidden_layer_and_second_hidden_layer_weights += (
														    updated_first_hidden_layer_and_second_hidden_layer_weights
														)
														self.second_hidden_layer_and_output_layer_weights += (
														    updated_second_hidden_layer_and_output_layer_weights
														)






							def 				_lowerCamelCase		(						self  , __lowerCAmelCase  , __lowerCAmelCase  , __lowerCAmelCase  ):
														for iteration in range(1  , iterations + 1  ):
																					UpperCamelCase__				     =			self.feedforward()
																					self.back_propagation()
																					if give_loss:
																												UpperCamelCase__				     =			numpy.mean(numpy.square(output - self.feedforward()  )  )
																												print(f"""Iteration {iteration} Loss: {loss}"""  )







							def 				_lowerCamelCase		(						self  , __lowerCAmelCase  ):
														UpperCamelCase__				     =			input_arr

														UpperCamelCase__				     =			sigmoid(
														    numpy.dot(self.array  , self.input_layer_and_first_hidden_layer_weights  )  )

														UpperCamelCase__				     =			sigmoid(
														    numpy.dot(
														        self.layer_between_input_and_first_hidden_layer  , self.first_hidden_layer_and_second_hidden_layer_weights  , )  )

														UpperCamelCase__				     =			sigmoid(
														    numpy.dot(
														        self.layer_between_first_hidden_layer_and_second_hidden_layer  , self.second_hidden_layer_and_output_layer_weights  , )  )

														return int(self.layer_between_second_hidden_layer_and_output > 0.6  )






def     _UpperCamelCase     (a__   :numpy.ndarray       ):






							"""simple docstring"""





							return 1 / (1 + numpy.exp(-value       ))





def     _UpperCamelCase     (a__   :numpy.ndarray       ):






							"""simple docstring"""





							return (value) * (1 - (value))





def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			numpy.array(
							    (
							        [0, 0, 0],
							        [0, 0, 1],
							        [0, 1, 0],
							        [0, 1, 1],
							        [1, 0, 0],
							        [1, 0, 1],
							        [1, 1, 0],
							        [1, 1, 1],
							    )   ,			dtype=numpy.floataa   ,			)

							# True output values for the given input values.
							UpperCamelCase__				     =			numpy.array(([0], [1], [1], [0], [1], [0], [0], [1])   ,			dtype=numpy.floataa       )

							# Calling neural network class.
							UpperCamelCase__				     =			TwoHiddenLayerNeuralNetwork(
							    input_array=a__   ,			output_array=a__       )

							# Calling training function.
							# Set give_loss to True if you want to see loss in every iteration.
							neural_network.train(output=a__   ,			iterations=10   ,			give_loss=a__       )

							return neural_network.predict(numpy.array(([1, 1, 1])   ,			dtype=numpy.floataa       )       )


if __name__ == "__main__":
					example()











import argparse
import datetime





def     _UpperCamelCase     (a__   :str       ):






							"""simple docstring"""





							UpperCamelCase__				     =			{
							    """0""": """Sunday""",
							    """1""": """Monday""",
							    """2""": """Tuesday""",
							    """3""": """Wednesday""",
							    """4""": """Thursday""",
							    """5""": """Friday""",
							    """6""": """Saturday""",
							}

							UpperCamelCase__				     =			{0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0}

							# Validate
							if not 0 < len(a__       ) < 11:
														raise ValueError("""Must be 10 characters long"""       )

							# Get month
							UpperCamelCase__				     =			int(date_input[0] + date_input[1]       )
							# Validate
							if not 0 < m < 13:
														raise ValueError("""Month must be between 1 - 12"""       )

							UpperCamelCase__				     =			date_input[2]
							# Validate
							if sep_a not in ["-", "/"]:
														raise ValueError("""Date separator must be '-' or '/'"""       )

							# Get day
							UpperCamelCase__				     =			int(date_input[3] + date_input[4]       )
							# Validate
							if not 0 < d < 32:
														raise ValueError("""Date must be between 1 - 31"""       )

							# Get second separator
							UpperCamelCase__				     =			date_input[5]
							# Validate
							if sep_a not in ["-", "/"]:
														raise ValueError("""Date separator must be '-' or '/'"""       )

							# Get year
							UpperCamelCase__				     =			int(date_input[6] + date_input[7] + date_input[8] + date_input[9]       )
							# Arbitrary year range
							if not 45 < y < 8500:
														raise ValueError(
														    """Year out of range. There has to be some sort of limit...right?"""       )

							# Get datetime obj for validation
							UpperCamelCase__				     =			datetime.date(int(a__       )   ,			int(a__       )   ,			int(a__       )       )

							# Start math
							if m <= 2:
														UpperCamelCase__				     =			y - 1
														UpperCamelCase__				     =			m + 12
							# maths var
							UpperCamelCase__				     =			int(str(a__       )[:2]       )
							UpperCamelCase__				     =			int(str(a__       )[2:]       )
							UpperCamelCase__				     =			int(2.6 * m - 5.39       )
							UpperCamelCase__				     =			int(c / 4       )
							UpperCamelCase__				     =			int(k / 4       )
							UpperCamelCase__				     =			int(d + k       )
							UpperCamelCase__				     =			int(t + u + v + x       )
							UpperCamelCase__				     =			int(z - (2 * c)       )
							UpperCamelCase__				     =			round(w % 7       )
							# End math

							# Validate math
							if f != convert_datetime_days[dt_ck.weekday()]:
														raise AssertionError("""The date was evaluated incorrectly. Contact developer."""       )

							# Response
							UpperCamelCase__				     =			f"""Your date {date_input}, is a {days[str(a__       )]}!"""
							return response


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					UpperCamelCase__											= argparse.ArgumentParser(
					    description=(
					        "Find out what day of the week nearly any date is or was. Enter "
					        "date as a string in the mm-dd-yyyy or mm/dd/yyyy format"
					    )
					)
					parser.add_argument(
					    "date_input", type=str, help="Date as a string (mm-dd-yyyy or mm/dd/yyyy)"
					)
					UpperCamelCase__											= parser.parse_args()
					zeller(args.date_input)




