[{'role': 'system', 'content': "You are an expert in machine learning and your task is to classify code snippets into one of the following categories: ['helper_functions', 'load_data', 'data_exploration', 'data_preprocessing', 'evaluation', 'modelling', 'prediction', 'result_visualization', 'save_results', 'comment_only']."}, {'role': 'user', 'content': 'Identify the single most appropriate category to which the provided code belongs. Provide your response as a single category label without any additional information, commentary, or personal opinions.\\nPython Code:import numpy as np, copy\nclass RNN:\ndef __init__(self, binary_dim=8, alpha=0.1, input_dim=2, hidden_dim=16, output_dim=1, iterations=10000):\nself.binary_dim = binary_dim\nself.alpha = alpha\nself.input_dim = input_dim\nself.hidden_dim = hidden_dim\nself.output_dim = output_dim\nself.iterations = iterations\nself.largest_number = 0\nself.int2binary = {}\nnp.random.seed()\nself.prepare_int2binary_map()\ndef sigmoid(self,x):\nreturn 1/(1+np.exp(-x))\ndef sigmoid_output_derivative(self,x):\nreturn x*(1-x)\ndef prepare_int2binary_map(self):\nself.largest_number = pow(2, self.binary_dim)\nbinary = np.unpackbits(np.array([range(self.largest_number)], dtype=np.uint8).T, axis=1)\nfor i in range(self.largest_number):\nself.int2binary[i] = binary[i]\ndef test(self, a_int, b_int):\ncorrect_answer = a_int + b_int\na = self.int2binary[a_int]\nb = self.int2binary[b_int]\nlayer1_values = list()\nlayer1_values.append(np.zeros(self.hidden_dim))\nlayer2_values = np.zeros(self.binary_dim)\nfor position in range(self.binary_dim):\nX = np.array([[a[self.binary_dim - position - 1],b[self.binary_dim - position - 1]]])\nlayer1 = self.sigmoid(np.dot(X,self.W0) + np.dot(layer1_values[-1],self.Wh))\nlayer1_values.append(layer1)\nlayer2_values[self.binary_dim - position - 1] = self.sigmoid(np.dot(layer1,self.W1))\nguess = np.packbits(np.round(layer2_values).astype(int))\nreturn guess\ndef train(self):\nself.W0 = 2*np.random.random((self.input_dim, self.hidden_dim)) - 1\nself.W1 = 2*np.random.random((self.hidden_dim, self.output_dim)) - 1\nself.Wh = 2*np.random.random((self.hidden_dim, self.hidden_dim)) - 1\nW0_update = np.zeros_like(self.W0)\nW1_update = np.zeros_like(self.W1)\nWh_update = np.zeros_like(self.Wh)\nfor j in range(self.iterations):\na_int = np.random.randint(self.largest_number/2)\na = self.int2binary[a_int]\nb_int = np.random.randint(self.largest_number/2)\nb = self.int2binary[b_int]\nc_int = a_int + b_int\nc = self.int2binary[c_int]\nd = np.zeros_like(c)\noverall_error = 0\nlayer2_deltas = list()\nlayer1_values = list()\nlayer1_values.append(np.zeros(self.hidden_dim))\nfor position in range(self.binary_dim):\nX = np.array([[a[self.binary_dim - position - 1],b[self.binary_dim - position - 1]]])\ny = np.array([[c[self.binary_dim - position - 1]]]).T\nlayer1 = self.sigmoid(np.dot(X,self.W0) + np.dot(layer1_values[-1],self.Wh))\nlayer2 = self.sigmoid(np.dot(layer1,self.W1))\nlayer2_error = y - layer2\nlayer2_deltas.append((layer2_error)*self.sigmoid_output_derivative(layer2))\noverall_error += np.abs(layer2_error[0])\nd[self.binary_dim - position - 1] = np.round(layer2[0][0])\nlayer1_values.append(copy.deepcopy(layer1))\nfuture_layer1_delta = np.zeros(self.hidden_dim)\nfor position in range(self.binary_dim):\nX = np.array([[a[position],b[position]]])\nlayer1 = layer1_values[-position - 1]\nprev_layer1 = layer1_values[-position - 2]\nlayer2_delta = layer2_deltas[-position-1]\nlayer1_delta = \\\n(future_layer1_delta.dot(self.Wh.T) + \\\nlayer2_delta.dot(self.W1.T)) * \\\nself.sigmoid_output_derivative(layer1)\nW1_update += np.atleast_2d(layer1).T.dot(layer2_delta)\nWh_update += np.atleast_2d(prev_layer1).T.dot(layer1_delta)\nW0_update += X.T.dot(layer1_delta)\nfuture_layer1_delta = layer1_delta\nself.W0 += W0_update * self.alpha\nself.W1 += W1_update * self.alpha\nself.Wh += Wh_update * self.alpha\nW0_update *= 0\nW1_update *= 0\nWh_update *= 0\nif j % 2000 == 0:\nprint("Error: %.5f" % overall_error)\nout = 0\nfor index,x in enumerate(reversed(d)):\nout += x*pow(2, index)\nprint("%d + %d = %d" % (a_int,b_int,out))\nprint("---------")'}, {'role': 'assistant', 'content': 'modelling'}]