You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2953 lines
268 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'r': {'count': 42, 'vector': [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], 'index': 8}, 'u': {'count': 55, 'vector': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], 'index': 11}, 'i': {'count': 75, 'vector': [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], 'index': 4}, 'l': {'count': 64, 'vector': [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], 'index': 5}, 't': {'count': 64, 'vector': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], 'index': 10}, 'o': {'count': 39, 'vector': [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], 'index': 7}, 'd': {'count': 45, 'vector': [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'index': 2}, 'c': {'count': 30, 'vector': [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'index': 1}, 'a': {'count': 36, 'vector': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'index': 0}, 'e': {'count': 117, 'vector': [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], 'index': 3}, 's': {'count': 40, 'vector': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], 'index': 9}, 'n': {'count': 75, 'vector': [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], 'index': 6}}\n",
"12\n",
"1\n",
"number of batches=4\n",
"2\n",
"size of first batch=256,256\n",
"size of last batch=47,47\n",
"300 31\n"
]
}
],
"source": [
"from letters import LettersData\n",
"letters_data = LettersData(\"data/\", \"list_expected_data.txt\")\n",
"letters_data.process()\n",
"#x,y = data.get_data()\n",
"#classes = data.get_classes()\n",
"#ysize = data.get_class_element_size()\n",
"#xsize = data.get_input_image_size()\n",
"#print(len(classes))\n",
"#print(len(classes['P']))\n",
"#print(xsize,ysize)\n",
"#print(len(x))\n",
"#print(len(y))\n",
"#print(y[5])\n",
"#print(data.get_vocab())\n",
"v=letters_data.get_vocab_with_min_count(30)\n",
"print(v)\n",
"print(len(v))\n",
"batch = letters_data.get_batches()\n",
"print(len(batch))\n",
"batch = letters_data.get_batches(mini_batch_size=256)#min_count=40, mini_batch_size=577)\n",
"print(\"number of batches={}\".format(len(batch)))\n",
"print(len(batch[0]))\n",
"print(\"size of first batch={},{}\".format(len(batch[0][0]),len(batch[0][1])))\n",
"print(\"size of last batch={},{}\".format(len(batch[-1][0]),len(batch[-1][1])))\n",
"xsize = len(batch[0][0][0])\n",
"ysize = len(batch[0][1][0])\n",
"print(xsize, ysize)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# BATCH LOAD AND SAVE FUNCTIONS\n",
"\n",
"def save_batch(filename, data):\n",
" with open(filename, \"w\") as f:\n",
" f.write(str(data))\n",
" print(\"ok\")\n",
"\n",
"def load_batch(filename):\n",
" batch = None\n",
" with open(filename) as f:\n",
" sbatch = f.read()\n",
" batch = eval(sbatch, {\"__builtins__\":None})\n",
" return batch\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n",
"batch-2018-01-24_13:37:28\n"
]
}
],
"source": [
"# SAVE BATCH\n",
"import datetime\n",
"\n",
"tm = str(datetime.datetime.now()).replace(\" \", \"_\").split(\".\")[0]\n",
"name = \"batch-\" + tm\n",
"save_batch(name, batch)\n",
"print(name)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"300 31\n"
]
}
],
"source": [
"# LOAD BATCH\n",
"\n",
"batch = load_batch(\"batch-2018-01-20_21:41:29\")\n",
"xsize = len(batch[0][0][0])\n",
"ysize = len(batch[0][1][0])\n",
"print(xsize, ysize)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0 2 4 6 9]\n",
" [1 3 5 7 8]]\n",
"[[0 0 0 0 1]\n",
" [1 1 1 1 0]]\n",
"35\n",
"[[11 2 13 4]\n",
" [ 5 6 7 8]]\n",
"[[1 0 1 0]\n",
" [0 1 0 1]]\n",
"18\n",
"1\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"def output_to_hard(output):\n",
" m = output.shape[1]\n",
" hard = np.zeros_like(output)\n",
" hard[output.argmax(0), np.arange(m)] = 1\n",
" return hard\n",
"\n",
"\n",
"def count_errors(output, expected_output):\n",
" \"\"\"Count the number of patterns different assuming dimension (n, m)\n",
" having m patterns of size n\n",
" \"\"\"\n",
" # check differences\n",
" err = np.equal(output,expected_output)\n",
" # invert such as true means not equal\n",
" ierr = np.invert(err)\n",
" # count number of bad values for each column\n",
" nb = np.count_nonzero(ierr, axis=0)\n",
" # count number of errors\n",
" nb_err = np.count_nonzero(nb)\n",
" return nb_err\n",
" \n",
"\n",
"def range_weighted_sum(vec):\n",
" rng = np.arange(1, vec.size+1, 1).reshape(vec.shape)\n",
" return np.sum(vec * rng)\n",
" \n",
" \n",
"a = np.array([[0, 1], [2, 3], [4, 5], [6, 7], [9, 8]]).T\n",
"print(a)\n",
"ah = output_to_hard(a)\n",
"print(ah)\n",
"print(range_weighted_sum(ah))\n",
"a = np.array([[11,2,13,4],[5,6,7,8]])\n",
"print(a)\n",
"b = np.array([[1, 0, 1, 0], [1, 1, 0, 1]])\n",
"h = output_to_hard(a)\n",
"print(h)\n",
"print(range_weighted_sum(h))\n",
"\n",
"print(count_errors(h, b))\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0. 3.]\n",
"False\n",
"True\n"
]
}
],
"source": [
"def all_axis_equal(n, axis=0):\n",
" \"\"\"\n",
" :param axis: if 0 check that all columns are equal, if 1 chech rows\n",
" \"\"\"\n",
" if axis == 0:\n",
" res = np.std(n, axis=1)\n",
" else:\n",
" res = np.std(n)\n",
" res = np.sum(res)\n",
" return res == 0.\n",
"\n",
"\n",
"def axis_equal(n, axis=0):\n",
" \"\"\"\n",
" :param axis: if 0 check that all columns are equal, if 1 chech rows\n",
" \"\"\"\n",
" if axis == 0:\n",
" res = np.std(n, axis=1)\n",
" else:\n",
" res = np.std(n)\n",
" return res\n",
"\n",
"\n",
"a=np.array([[1,-2,3,4],[5,6,-7,8]])\n",
"all_axis_equal(a)\n",
"a=np.array([[1,-2,3,4],[1,6,-7,8]])\n",
"all_axis_equal(a) \n",
"\n",
"a = np.array([[-1., -1.], [-3., 3]])\n",
"print(np.std(a,axis=1))\n",
"\n",
"b=np.array([[-2,-2,-2],[5,6,-7]])\n",
"print(all_axis_equal(b))\n",
"b=np.array([[-2,-2,-2],[5,5,5]])\n",
"print(all_axis_equal(b))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n"
]
}
],
"source": [
"# CREATE MLP\n",
"\n",
"from mlp import MultiLayerPerceptron\n",
"import numpy as np\n",
"\n",
"xsize = len(batch[0][0][0])\n",
"ysize = len(batch[0][1][0])\n",
"print(batch[0][1][0])\n",
"m = len(batch[0][0])\n",
"\n",
"# create MLP architecture\n",
"mlp = MultiLayerPerceptron(L=5, n=[xsize, 1800, 600, 300, 30, ysize], g=[\"tanh\"]*4 + [\"softmax\"], alpha=0.001, set_random_w=False)\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"815\n"
]
}
],
"source": [
"# PREPARE INPUTS\n",
"\n",
"X, Y = np.array(batch[0][0]), np.array(batch[0][1])\n",
"m = len(batch[0][0])\n",
"print(m)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"# FEED NETWORK with inputs,expected outputs\n",
"\n",
"mlp.set_all_training_examples(X.T, Y.T, m)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"tanh factor=0.05773502691896258\n",
"tanh factor=0.023570226039551584\n",
"tanh factor=0.040824829046386304\n",
"tanh factor=0.05773502691896258\n",
"softmax factor=0.01\n",
"lenX,m 300 815\n",
"nb errors before training=783/815\n",
"Training...\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHuFJREFUeJzt3XmUXGd55/HvU0tX9d5Sd6m178JYNl47wowZYJw4IzuMnRlMMCfDFsADgWOYJGfCMscJ5OScMExIIDgYgz22CQMmZhnHY8cYMNh48NK2JaEF2y3LsmS11YusXtVLdT3zR92WSq1qdbVUS1fV73NOnbp171t1H91u/e7tt957r7k7IiJSWUKlLkBERPJP4S4iUoEU7iIiFUjhLiJSgRTuIiIVSOEuIlKBFO4iIhVI4S4iUoEU7iIiFShSqhW3tbX52rVrS7V6EZGy9PTTT/e5e2KudiUL97Vr19LZ2Vmq1YuIlCUz259LO3XLiIhUoDnD3cziZvakmW03s11m9rksbd5vZr1mti14fKgw5YqISC5y6ZYZB65w92EziwK/NLMH3P3xGe3udveP579EERGZrznD3dPXBB4OXkaDh64TLCKygOXU525mYTPbBvQAD7n7E1mavcPMdpjZPWa2Kq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dZsV/AY+s9T1m4ydtJHu187cZgX/Wbr7p919pbuvJZ1TP3P3P6SY2+tsv5Et9oP0t93Pk+7v+2wJ61hPeqTCdmDXdC2k+8l+CrwA/ARYXIRavkP6z/VJ0v14H5ytDtKjBG4Ott+vgY4i1/WtYL07gl/oZRntPxvU9RxwVQHrejPpLpcdwLbgcXWpt9lp6loI2+wC4Nmghp3ATRn/D54k/WXuPwOxYH48eN0VLF9f5Lp+FmyzncA/cWJETdF+/zNqfBsnRssUbXvpDFURkQpUbt0yIiKSA4W7iEgFUriLiFQghbuISAVSuIuIVCCFu4hIBVK4i4hUIIW7iEgF+v/WIots0I55TgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7faad5fb4828>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"learning duration=423.5131194591522(s)\n",
"{'iterations': 400, 'cost_function': 0.05707730196227899}\n",
"nb errors=0/815\n"
]
}
],
"source": [
"# TRAINING MLP\n",
"\n",
"import time\n",
"\n",
"# random weights\n",
"mlp.init_random_weights(use_formula=True)\n",
"#mlp.use_regularization(0.1)\n",
"mlp.use_adam()\n",
"\n",
"# Compute output\n",
"output = mlp.compute_outputs(X.T)\n",
"hard_output = output_to_hard(output)\n",
"mlp.set_all_expected_output_examples(Y.T)\n",
"expected_output = mlp.get_expected_output()\n",
"print(\"nb errors before training={}/{}\".format(count_errors(hard_output, expected_output), output.shape[1]))\n",
"\n",
"# Proceed learning with gradient descent\n",
"print(\"Training...\")\n",
"t0 = time.time()\n",
"res = mlp.learning(X.T, Y.T, m, min_cost=0.005, max_iter=400, plot=True)\n",
"t1 = time.time()\n",
"print(\"learning duration={}(s)\".format(t1-t0))\n",
"print(res)\n",
"\n",
"output = mlp.get_output()\n",
"hard_output = output_to_hard(output)\n",
"expected_output = mlp.get_expected_output()\n",
"print(\"nb errors={}/{}\".format(count_errors(hard_output, expected_output), output.shape[1]))\n"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"number of batches=7\n",
"nb train=4, nb test=3\n",
"2\n",
"size of first batch=128,128\n",
"size of last batch=47,47\n"
]
}
],
"source": [
"# BATCHES\n",
"\n",
"from letters import LettersData\n",
"letters_data = LettersData(\"data/\", \"list_expected_data.txt\")\n",
"letters_data.process()\n",
"batches = letters_data.get_batches(mini_batch_size=128)#min_count=40, mini_batch_size=577)\n",
"print(\"number of batches={}\".format(len(batches)))\n",
"lim = int(len(batches) * 70 / 100)\n",
"batch_train = batches[:lim]\n",
"batch_test = batches[lim:]\n",
"print(\"nb train={}, nb test={}\".format(len(batch_train), len(batch_test)))\n",
"print(len(batches[0]))\n",
"print(\"size of first batch={},{}\".format(len(batches[0][0]),len(batches[0][1])))\n",
"print(\"size of last batch={},{}\".format(len(batches[-1][0]),len(batches[-1][1])))\n",
"#xsize = len(batch[0][0][0])\n",
"#ysize = len(batch[0][1][0])\n",
"#print(xsize, ysize)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"tanh factor=0.05773502691896258\n",
"tanh factor=0.023570226039551584\n",
"tanh factor=0.040824829046386304\n",
"tanh factor=0.05773502691896258\n",
"softmax factor=0.01\n",
"Training...\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHepJREFUeJzt3XmUXOV55/HvU2uv6tbSLbU2JIHYQSwKxoBtDMNqAlnwBCbEyzjDxMtgZzjOMM6Jk3BOTsaZiXEcMsYMEC/jYE+E7SgE44BNWGyQLWRJIIlFrNrVraUX9VpVz/xxb7dKTTdd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SrjocmAzMd/XBN0xF5pZXfjvfXi7Y7uvi4y3b1cDHwlHzVwIdBZ13xwfd5/2D+Ba4BXgNeCPo65nkrbxEoI/1TYC68PHtQT9zz8BXgUeB2ZFXesk/je4FHg4nF4G/ALYCvwjkI26vjJv6znA2nB//xCYWQ37Gvhz4CXgReDbQDZu+xp4kOA3hSGCv9I+Md6+BYxgNOBrwAsEI4nKUofOUBURiaFK6JYREZGjpHAXEYkhhbuISAwp3EVEYkjhLiISQwp3EZEYUriLiMSQwl1EJIb+P6jKp/nLsX8GAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f63941ff208>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"learning duration=92.83850836753845(s)\n",
"{'iterations': 100, 'cost_function': 0.0429865491059762}\n",
"nb errors=0/128\n"
]
}
],
"source": [
"# TRAINING MLP WITH BATCHES\n",
"\n",
"import time\n",
"\n",
"# random weights\n",
"mlp.init_random_weights(use_formula=True)\n",
"#mlp.use_regularization(0.1)\n",
"mlp.use_adam()\n",
"\n",
"# Compute output\n",
"#output = mlp.compute_outputs(X.T)\n",
"#hard_output = output_to_hard(output)\n",
"#mlp.set_all_expected_output_examples(Y.T)\n",
"#expected_output = mlp.get_expected_output()\n",
"#print(\"nb errors before training={}/{}\".format(count_errors(hard_output, expected_output), output.shape[1]))\n",
"\n",
"# Proceed learning with gradient descent\n",
"mlp.set_batches(batch_train)\n",
"print(\"Training...\")\n",
"t0 = time.time()\n",
"res = mlp.learning_batches(min_cost=0.005, max_iter=100, plot=True)\n",
"t1 = time.time()\n",
"print(\"learning duration={}(s)\".format(t1-t0))\n",
"print(res)\n",
"\n",
"output = mlp.get_output()\n",
"hard_output = output_to_hard(output)\n",
"expected_output = mlp.get_expected_output()\n",
"print(\"nb errors={}/{}\".format(count_errors(hard_output, expected_output), output.shape[1]))\n"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 1., 0., ..., 0., 1., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]), array([[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]]))"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# FEED NETWORK with inputs,expected outputs\n",
"\n",
"X, Y = batch_test, batch_test\n",
"m = len(batch_test)\n",
"mlp.set_batches(batch_test)\n",
"X, Y = mlp.get_next_batch()\n",
"r = mlp.compute_outputs(X)\n",
"h = output_to_hard(o)\n",
"count_errors(h, Y)\n",
"h, Y"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" ...\n",
" [0 0 0 ... 0 0 0]\n",
" [0 1 0 ... 0 1 0]\n",
" [0 0 0 ... 0 0 0]]\n",
"128\n",
"271808\n",
"out=[[4.81667146e-05 2.51492532e-04 2.56889299e-05 ... 6.60370897e-05\n",
" 2.51525196e-04 9.43324894e-05]\n",
" [4.41886128e-05 1.17905017e-03 3.90737385e-04 ... 2.11062502e-05\n",
" 1.17912692e-03 2.12986116e-05]\n",
" [9.67067790e-04 1.32441114e-03 2.69466055e-05 ... 7.14004847e-04\n",
" 1.32472607e-03 7.09027063e-05]\n",
" ...\n",
" [7.37804103e-05 1.09578011e-04 7.50031685e-05 ... 7.42543885e-05\n",
" 1.09573573e-04 8.71104924e-05]\n",
" [4.70822223e-06 9.41112562e-01 1.36628466e-04 ... 1.04041238e-05\n",
" 9.41116874e-01 4.39763400e-04]\n",
" [6.02335258e-05 1.57699572e-02 1.44736737e-04 ... 3.98461885e-05\n",
" 1.57730226e-02 2.20319215e-04]]\n",
"alleq? = False\n",
"eq? = [4.50656052e-02 1.67496256e-01 1.45867702e-01 1.20243442e-04\n",
" 4.55609746e-03 9.47595466e-03 1.06862773e-04 1.67961138e-02\n",
" 2.46510997e-01 2.43116554e-03 1.81810939e-01 1.91403397e-01\n",
" 3.45885396e-01 4.46872787e-03 1.06647101e-04 2.49096459e-01\n",
" 2.60941175e-01 2.25570328e-01 1.99436845e-01 1.86424889e-01\n",
" 1.45046509e-01 2.62481722e-01 2.65334997e-01 2.37274401e-01\n",
" 2.11824021e-01 8.57866305e-02 8.35423212e-04 7.89769507e-02\n",
" 1.03024375e-04 1.63612576e-01 2.84081880e-03]\n",
"hout=[[0. 0. 0. ... 0. 0. 0.]\n",
" [0. 0. 0. ... 0. 0. 0.]\n",
" [0. 0. 0. ... 0. 0. 0.]\n",
" ...\n",
" [0. 0. 0. ... 0. 0. 0.]\n",
" [0. 1. 0. ... 0. 1. 0.]\n",
" [0. 0. 0. ... 0. 0. 0.]]\n",
"271808.0\n",
"alleq? = False\n",
"expout=[[0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" ...\n",
" [0 0 0 ... 0 0 0]\n",
" [0 1 0 ... 0 1 0]\n",
" [0 0 0 ... 0 0 0]]\n",
"271808\n",
"nb errors=0\n",
"76694480\n",
"ieq? = [0. 0. 0. 0. 0. 0.\n",
" 0. 0. 0. 0. 0. 0.\n",
" 0. 0. 0. 0. 0. 0.15128841\n",
" 0. 0.17399264 0.17399264 0.15128841 0. 0.\n",
" 0. 0. 0. 0. 0.15128841 0.26836819\n",
" 0.15128841 0.15128841 0.17399264 0.17399264 0. 0.\n",
" 0. 0. 0. 0. 0.1937437 0.31210913\n",
" 0.25567294 0.0880424 0.1937437 0.17399264 0. 0.\n",
" 0. 0. 0. 0. 0. 0.33937198\n",
" 0.26836819 0.12401959 0.1937437 0.1937437 0. 0.\n",
" 0. 0. 0. 0. 0.12401959 0.33071891\n",
" 0.32164358 0. 0.1937437 0.1937437 0. 0.\n",
" 0. 0. 0. 0. 0. 0.32164358\n",
" 0.28027174 0.0880424 0.1937437 0.1937437 0. 0.\n",
" 0. 0.12401959 0.12401959 0.0880424 0.31210913 0.44572349\n",
" 0.41860714 0.3476343 0.25567294 0.22736925 0. 0.\n",
" 0. 0.17399264 0.33071891 0.44572349 0.453327 0.47981727\n",
" 0.48203821 0.46351241 0.40797411 0.24206146 0. 0.\n",
" 0. 0.33071891 0.44960921 0.49607837 0.49385877 0.48203821\n",
" 0.48203821 0.49255938 0.48203821 0.35553313 0. 0.\n",
" 0. 0.38392695 0.48607313 0.49993896 0.49847179 0.47745817\n",
" 0.44572349 0.48957641 0.49503147 0.42360755 0.12401959 0.\n",
" 0.15128841 0.37033228 0.49607837 0.49993896 0.47981727 0.4695306\n",
" 0.41339864 0.39031237 0.47981727 0.44960921 0.15128841 0.\n",
" 0.15128841 0.39644108 0.49779789 0.49847179 0.46659662 0.47231716\n",
" 0.42360755 0.38392695 0.45688098 0.44166544 0.21137108 0.\n",
" 0. 0.37033228 0.49993896 0.49255938 0.42360755 0.47231716\n",
" 0.42360755 0.35553313 0.4330127 0.44166544 0.21137108 0.\n",
" 0. 0.36309219 0.49945038 0.49945038 0.41339864 0.44572349\n",
" 0.40232479 0.40232479 0.44166544 0.4330127 0.0880424 0.\n",
" 0. 0.25567294 0.49255938 0.49945038 0.49385877 0.48412292\n",
" 0.44572349 0.47981727 0.49385877 0.42840718 0.15128841 0.\n",
" 0. 0.17399264 0.45688098 0.49945038 0.49385877 0.4911323\n",
" 0.47981727 0.48607313 0.46659662 0.37033228 0.12401959 0.\n",
" 0. 0.0880424 0.37033228 0.48203821 0.47495888 0.46351241\n",
" 0.44166544 0.42360755 0.35553313 0.2914806 0. 0.\n",
" 0. 0.0880424 0.25567294 0.32164358 0.33937198 0.37727176\n",
" 0.37727176 0.24206146 0.24206146 0.21137108 0. 0.\n",
" 0. 0.12401959 0.21137108 0.21137108 0. 0.15128841\n",
" 0.15128841 0. 0.15128841 0.15128841 0. 0.\n",
" 0. 0.12401959 0.21137108 0.21137108 0. 0.12401959\n",
" 0.0880424 0. 0.15128841 0.15128841 0.0880424 0.\n",
" 0. 0.1937437 0.21137108 0.21137108 0. 0.0880424\n",
" 0. 0. 0.12401959 0.12401959 0. 0.\n",
" 0. 0.12401959 0.0880424 0.12401959 0. 0.\n",
" 0. 0. 0.12401959 0.12401959 0. 0.\n",
" 0. 0. 0. 0. 0. 0.\n",
" 0. 0. 0. 0. 0. 0.\n",
" 0. 0. 0. 0. 0. 0.\n",
" 0. 0. 0. 0. 0. 0. ]\n",
"i? = [[0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" ...\n",
" [0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]\n",
" [0 0 0 ... 0 0 0]]\n",
"diff exp= [ 1 4 3 0 0 0 0 0 9 0 5 5 19 0 0 9 10 8 6 5 3 10 10 8\n",
" 7 1 0 1 0 4 0]\n",
"[[-0.00324666 0.0008685 -0.10104286 ... -0.13601123 -0.00671438\n",
" 0.06617922]\n",
" [ 0.01784416 -0.06281528 0.05495157 ... -0.05346315 -0.0261274\n",
" 0.02987064]\n",
" [ 0.02463508 -0.03563505 -0.00925549 ... -0.01917858 0.03525635\n",
" -0.08205339]\n",
" ...\n",
" [-0.01318291 -0.03899108 -0.03137097 ... 0.07893079 0.0268401\n",
" 0.07872519]\n",
" [-0.04341548 0.04744597 0.03157013 ... 0.05247824 0.00975248\n",
" -0.10081767]\n",
" [-0.09271694 0.04267457 0.11779636 ... -0.03687039 -0.0015042\n",
" -0.04008934]]\n",
"float64\n",
"[[-0.05701703 -0.04888133 -0.01998078 ... 0.01132182 -0.03501858\n",
" 0.036734 ]\n",
" [ 0.04179174 -0.02082482 -0.01263243 ... -0.0292859 -0.01351609\n",
" -0.09430827]\n",
" [-0.05381584 -0.00071092 -0.04304324 ... 0.01380626 -0.06682077\n",
" -0.00978878]\n",
" ...\n",
" [ 0.00561043 0.02237729 0.0128138 ... -0.00980096 -0.01296052\n",
" 0.02124782]\n",
" [ 0.119067 0.08050831 0.09264226 ... -0.01759468 0.09545502\n",
" 0.03928334]\n",
" [-0.04037504 0.06551944 0.02158193 ... 0.08979575 0.00216517\n",
" -0.00773649]]\n",
"float64\n",
"[[ 0.0429313 -0.02589082 0.01471088 ... -0.09674027 0.08882899\n",
" 0.01273433]\n",
" [-0.02520829 -0.02231071 -0.05452196 ... -0.08612748 0.05594415\n",
" 0.02374242]\n",
" [-0.03289537 -0.08335208 0.13244499 ... 0.06374945 0.01234061\n",
" 0.09038925]\n",
" ...\n",
" [-0.00540673 -0.09696876 0.02903404 ... -0.08140344 0.07986003\n",
" -0.00036132]\n",
" [-0.03795523 -0.0230879 0.00431476 ... 0.07609646 0.15815737\n",
" 0.0505698 ]\n",
" [ 0.00068026 -0.01303427 0.05587063 ... -0.10055906 -0.04867953\n",
" -0.07769197]]\n",
"float64\n",
"[[-0.11539659 -0.13374381 0.018418 ... -0.07976543 -0.16450755\n",
" 0.01566846]\n",
" [-0.09362723 -0.28165539 0.0723356 ... -0.21493733 -0.03201043\n",
" 0.00912683]\n",
" [-0.1257149 -0.00243859 0.15192195 ... 0.13760308 0.01472072\n",
" -0.00892478]\n",
" ...\n",
" [-0.01131486 -0.01303426 0.05497164 ... 0.16911199 -0.01565058\n",
" 0.01002137]\n",
" [ 0.04733466 0.06326436 -0.07836351 ... 0.04118668 0.03751298\n",
" 0.09558597]\n",
" [-0.13888119 -0.08472769 0.01332896 ... -0.01221111 -0.10381216\n",
" 0.2222039 ]]\n",
"float64\n",
"[[ 3.31073838e-01 -2.90831185e-01 1.56481122e-01 2.35394629e-01\n",
" -2.98081786e-01 2.52284864e-01 -2.79246678e-01 -1.01401447e-01\n",
" -1.22745157e-01 2.26424752e-01 -1.79473595e-01 -2.95038627e-01\n",
" 2.19523887e-01 -1.75309756e-01 -1.62784087e-01 -2.79850867e-01\n",
" 2.38234381e-01 -3.14241897e-01 -3.16668251e-01 -1.63008160e-01\n",
" 1.20432032e-01 3.72461410e-01 -2.37591705e-01 4.52074729e-01\n",
" -1.66461394e-01 -1.99152610e-01 -1.42377565e-01 2.04058058e-01\n",
" 2.82067765e-01 2.58554245e-01]\n",
" [ 2.52698018e-01 2.87433599e-01 1.88436089e-01 -3.96205116e-01\n",
" -2.95702759e-01 4.27565017e-01 -2.13340610e-01 -3.00880006e-01\n",
" -1.58900107e-01 2.45228968e-01 -2.05841947e-01 -4.52928174e-01\n",
" -2.92169047e-01 3.09552123e-01 3.19962992e-01 -2.56529877e-01\n",
" 4.44352094e-01 2.93848704e-01 2.35424969e-01 2.76498887e-01\n",
" 3.95967451e-01 -2.49619784e-01 -2.41049534e-01 -3.13997709e-01\n",
" -1.56788671e-01 3.22168918e-01 -2.05394348e-01 4.35428304e-01\n",
" -2.47321191e-01 -2.82769459e-01]\n",
" [ 2.86324210e-01 -4.03037185e-01 2.43918016e-01 2.37767384e-01\n",
" -1.97675622e-01 3.61553000e-01 3.79688828e-01 -1.83675480e-01\n",
" -2.04914893e-01 2.11192978e-01 -2.16774033e-01 4.10110235e-01\n",
" 2.80110801e-01 4.21724880e-01 3.55500900e-01 -2.03683189e-01\n",
" 3.56810445e-01 -3.46500725e-01 4.16371508e-01 -3.02084050e-01\n",
" 2.26953524e-01 -4.52471582e-01 -1.75079614e-01 -2.53760799e-01\n",
" -2.55510259e-01 -3.34643649e-01 -2.52671441e-01 3.62833733e-01\n",
" -3.42549121e-01 2.92499654e-01]\n",
" [ 1.37486775e-02 1.84049790e-02 -2.55986981e-02 4.75369487e-02\n",
" -5.95354728e-02 8.24515556e-02 -6.44025438e-03 1.50196265e-01\n",
" 1.17274314e-01 5.11277330e-02 -1.94330250e-02 -1.00652547e-01\n",
" 8.97576804e-02 -2.98501020e-02 6.24068492e-03 -7.25229755e-02\n",
" 1.19540980e-01 -6.29622176e-02 -1.29693101e-01 -5.64237755e-02\n",
" -1.17658871e-02 2.93616277e-02 -6.72849459e-02 -1.61939733e-01\n",
" -1.22740185e-02 -8.81902876e-03 5.64701087e-03 9.40013265e-02\n",
" 1.08857143e-01 9.06266490e-02]\n",
" [-3.76462635e-01 -3.01808931e-01 1.84097419e-01 2.30231530e-01\n",
" -2.95282334e-01 2.53786911e-01 4.18807733e-01 -1.78191665e-01\n",
" -1.75766475e-01 2.74281572e-01 -1.90374793e-01 -2.41255461e-01\n",
" 2.62358321e-01 -2.04074028e-01 -2.68204077e-01 -2.63757534e-01\n",
" 2.76150465e-01 -2.79868217e-01 -2.72229874e-01 -2.25890591e-01\n",
" 1.77371647e-01 -3.70400394e-01 -2.20947217e-01 -3.59557381e-01\n",
" -2.08066816e-01 -1.96889103e-01 -2.20556656e-01 2.17992599e-01\n",
" 2.22598072e-01 2.64308598e-01]\n",
" [ 2.57528690e-01 4.80099653e-01 1.45036661e-01 1.95553190e-01\n",
" -2.37956742e-01 2.78559127e-01 -2.92698481e-01 -1.30691945e-01\n",
" -1.10562117e-01 2.22443862e-01 -1.88771380e-01 -2.50730130e-01\n",
" 2.41842092e-01 -1.18992630e-01 -2.15306549e-01 -2.32690411e-01\n",
" 3.03870038e-01 -3.31166636e-01 -2.84838344e-01 -1.79278576e-01\n",
" 1.16438948e-01 3.75459992e-01 -2.21238298e-01 -3.66886653e-01\n",
" -1.82775927e-01 -2.50444753e-01 -1.59721779e-01 2.48783001e-01\n",
" 2.47778916e-01 2.61708628e-01]\n",
" [ 1.13951365e-02 1.58475075e-02 -1.15151363e-02 4.08183186e-02\n",
" -5.96174239e-02 6.16338754e-02 -1.79089004e-02 9.51512357e-02\n",
" 9.20260967e-02 3.67953087e-02 -2.95153818e-02 -9.69162537e-02\n",
" 7.77662399e-02 -2.23722948e-02 6.14743312e-03 -5.82502315e-02\n",
" 1.35642756e-01 -7.94697856e-02 -1.39481275e-01 -3.71431022e-02\n",
" 1.46617318e-02 2.78784873e-02 -6.94091563e-02 -1.24549992e-01\n",
" -5.35309573e-03 -1.71255893e-02 8.38815487e-03 6.37816248e-02\n",
" 9.47298982e-02 9.58225189e-02]\n",
" [ 3.37494857e-01 -3.45274246e-01 1.30580825e-01 1.93485781e-01\n",
" -2.60408978e-01 2.33906485e-01 -3.39854696e-01 -1.10876242e-01\n",
" -1.26175223e-01 2.32566414e-01 -1.63468333e-01 -2.90749206e-01\n",
" 2.40102770e-01 -1.46408849e-01 -2.11515091e-01 -2.32102974e-01\n",
" 2.38341107e-01 -2.69484020e-01 -3.03696687e-01 -1.80073311e-01\n",
" 1.03336259e-01 3.18335349e-01 -2.22564933e-01 -4.29311253e-01\n",
" -1.58423854e-01 -2.05745570e-01 -1.39232910e-01 2.12183975e-01\n",
" 2.88022580e-01 2.45597607e-01]\n",
" [-4.28211522e-01 3.96601397e-01 2.73538326e-01 -1.90019115e-01\n",
" 1.62110483e-01 3.38314057e-01 -3.52193524e-01 2.49770987e-01\n",
" -2.94599615e-01 -2.09835646e-01 -3.21260377e-01 -2.92855774e-01\n",
" -1.88872361e-01 -2.91027470e-01 -2.15298590e-01 1.84431507e-01\n",
" -5.26989732e-01 2.84521946e-01 -2.81117389e-01 1.81398574e-01\n",
" -5.07099991e-01 -2.42503981e-01 2.01572111e-01 1.71427374e-01\n",
" -3.42784286e-01 3.00312344e-01 -2.67603719e-01 3.12357653e-01\n",
" 2.83163853e-01 -1.76984842e-01]\n",
" [-3.00606197e-01 -2.46607907e-01 2.87822118e-01 -2.46601771e-01\n",
" -3.76447907e-01 2.78637833e-01 -3.05679701e-01 -2.37171249e-01\n",
" -3.79515638e-01 3.98414294e-01 -4.08882339e-01 -2.34390413e-01\n",
" 3.95436027e-01 4.49526055e-01 -2.17142521e-01 3.27447455e-01\n",
" 2.44061867e-01 3.40793157e-01 -2.48425333e-01 -2.89746854e-01\n",
" 2.04614129e-01 3.48275420e-01 3.10158434e-01 1.49680538e-01\n",
" -1.93484447e-01 -2.41024914e-01 -1.53255358e-01 2.00413923e-01\n",
" 2.56169067e-01 -3.24181578e-01]\n",
" [-2.03686239e-01 -2.19147707e-01 4.31992910e-01 -1.94613944e-01\n",
" 1.43384958e-01 2.84637428e-01 3.71891202e-01 2.01574914e-01\n",
" 3.51434400e-01 -1.84348685e-01 3.39251726e-01 3.33755949e-01\n",
" -1.65643141e-01 -2.09935934e-01 -2.09507992e-01 2.04597443e-01\n",
" 3.72039959e-01 -3.10280491e-01 2.91124277e-01 1.90862531e-01\n",
" -3.52388409e-01 -2.86468331e-01 2.92514383e-01 1.58382879e-01\n",
" 3.57378627e-01 -3.01195722e-01 -3.92531043e-01 3.85466910e-01\n",
" -3.46230089e-01 -1.93808503e-01]\n",
" [-2.20726013e-01 -2.41049855e-01 -3.19791999e-01 -2.07543265e-01\n",
" 2.12905978e-01 -3.09711278e-01 -3.29441701e-01 2.89988996e-01\n",
" 3.04706626e-01 3.53816903e-01 2.76352442e-01 -2.57972433e-01\n",
" -1.73556539e-01 2.90939585e-01 3.77845044e-01 -3.52771391e-01\n",
" 2.74818232e-01 2.72234566e-01 3.62435383e-01 2.81557770e-01\n",
" -3.38499043e-01 -3.56816480e-01 1.99212041e-01 2.07775174e-01\n",
" -3.13925336e-01 -3.19067245e-01 3.26242678e-01 2.81018493e-01\n",
" 2.65427244e-01 -1.68126137e-01]\n",
" [-2.36370877e-01 -2.31501738e-01 -5.18905165e-01 -2.27309413e-01\n",
" 2.01236350e-01 3.62137296e-01 2.33335827e-01 2.17177669e-01\n",
" 2.77201491e-01 -2.09146915e-01 2.48756946e-01 3.75700290e-01\n",
" -2.07401448e-01 -2.88067531e-01 -2.31539971e-01 2.21648796e-01\n",
" -5.49359129e-01 -3.79913073e-01 3.86753706e-01 2.21455115e-01\n",
" -2.48504816e-01 -2.64948631e-01 1.99653395e-01 2.05964161e-01\n",
" 2.44750178e-01 -3.52497908e-01 5.26724507e-01 -5.35601298e-01\n",
" -3.80899878e-01 -2.14488840e-01]\n",
" [-3.11736085e-01 -2.42533927e-01 1.34923477e-01 2.25358733e-01\n",
" 3.67592424e-01 2.04093599e-01 -2.78181276e-01 -1.92115500e-01\n",
" -7.85879801e-02 -2.85976635e-01 -2.50496608e-01 -2.64329186e-01\n",
" 3.21509188e-01 -2.52081188e-01 -1.52830018e-01 -3.32257519e-01\n",
" 2.23890834e-01 -3.29123076e-01 -2.98732287e-01 -2.34646033e-01\n",
" 1.48187036e-01 -2.87223197e-01 -2.91843953e-01 2.99346511e-01\n",
" -1.52993472e-01 -1.89473970e-01 -1.34493488e-01 1.48746450e-01\n",
" 2.64153865e-01 2.80413342e-01]\n",
" [ 4.88179725e-03 9.20273417e-03 -9.36123957e-03 5.11232744e-02\n",
" -8.05561971e-02 6.97142333e-02 -1.84310596e-02 1.38796274e-01\n",
" 9.64369137e-02 5.46621640e-02 -1.14057566e-02 -9.20739306e-02\n",
" 7.71566557e-02 -1.92553131e-02 1.12190717e-03 -6.52854171e-02\n",
" 1.32861917e-01 -7.19552527e-02 -1.40984664e-01 -6.41238002e-02\n",
" -3.85702836e-04 2.66076086e-02 -7.16454354e-02 -1.15643223e-01\n",
" -1.65892248e-03 -5.36281836e-03 1.13173283e-02 7.21674023e-02\n",
" 9.50009506e-02 1.03000891e-01]\n",
" [ 1.65553653e-01 2.21525224e-01 2.79681548e-01 1.92540339e-01\n",
" -1.77961759e-01 -2.83873174e-01 -3.80460907e-01 -1.97723008e-01\n",
" -1.82964216e-01 2.11961162e-01 -2.75111987e-01 2.11231155e-01\n",
" 4.37590916e-01 2.41860318e-01 1.99959701e-01 -2.44788077e-01\n",
" -2.44505988e-01 4.12368335e-01 2.55455697e-01 -4.66428218e-01\n",
" 4.40476061e-01 4.80241241e-01 -2.55434312e-01 -1.81827238e-01\n",
" -3.25303117e-01 3.33993731e-01 -2.82593724e-01 -2.85758958e-01\n",
" -2.49177375e-01 4.51348027e-01]\n",
" [ 1.96335571e-01 2.10407563e-01 2.23049570e-01 3.36143849e-01\n",
" -2.07366230e-01 -3.59530516e-01 -2.36055018e-01 -2.10914801e-01\n",
" -1.83008569e-01 2.01401830e-01 -2.26414464e-01 3.71314516e-01\n",
" -4.21095262e-01 2.06934786e-01 2.03657591e-01 -2.05661038e-01\n",
" -3.60442277e-01 2.92886418e-01 2.17045908e-01 4.74743140e-01\n",
" -1.74518023e-01 -4.99075045e-01 -2.07843371e-01 -2.18959412e-01\n",
" -2.33417495e-01 2.75011676e-01 -1.82623820e-01 -3.92526670e-01\n",
" -2.20441281e-01 -4.31630694e-01]\n",
" [-1.41462868e-01 -2.26005453e-01 -2.78204369e-01 -1.54211868e-01\n",
" 1.28073952e-01 -4.48825364e-01 2.65538564e-01 1.65309156e-01\n",
" 6.54308203e-01 -1.63858522e-01 2.21493677e-01 -3.80969956e-01\n",
" -1.58370955e-01 -7.72363899e-01 -1.72151243e-01 1.64815848e-01\n",
" -5.94978829e-01 4.10227568e-01 -3.95347994e-01 1.78093533e-01\n",
" -1.66691828e-01 -5.98664944e-01 1.40903060e-01 1.31350649e-01\n",
" 2.92659050e-01 4.37872134e-01 6.03781964e-01 -3.32984035e-01\n",
" 3.74783373e-01 -1.38282485e-01]\n",
" [-1.68109984e-01 -1.92335053e-01 -2.67319382e-01 -1.55479547e-01\n",
" 1.17168802e-01 -3.22862034e-01 3.24096772e-01 2.64187186e-01\n",
" 5.28300499e-01 -2.07125334e-01 2.11960932e-01 -2.65072299e-01\n",
" -1.73715095e-01 3.97836831e-01 -2.23489889e-01 2.05419638e-01\n",
" 6.15731381e-01 2.91776648e-01 -2.95565845e-01 2.96123736e-01\n",
" -3.05913156e-01 6.58917916e-01 1.38141165e-01 1.35803604e-01\n",
" 3.80457779e-01 4.03781766e-01 5.26008843e-01 -3.71957107e-01\n",
" 2.77244234e-01 -1.71537236e-01]\n",
" [-1.79599838e-01 -2.33892335e-01 4.25923918e-01 -1.98522708e-01\n",
" 2.13657419e-01 4.12960391e-01 4.59188666e-01 -2.44015666e-01\n",
" 3.45134678e-01 -2.43913034e-01 3.32792557e-01 -2.85255304e-01\n",
" -2.14259507e-01 -4.47671386e-01 -1.76203815e-01 2.11755325e-01\n",
" 2.63345912e-01 3.13031399e-01 -2.94015604e-01 -3.58066753e-01\n",
" 2.75278985e-01 3.03384562e-01 1.80391322e-01 1.49805427e-01\n",
" -3.27472510e-01 -2.97143972e-01 -2.28208911e-01 2.60190232e-01\n",
" 2.97406804e-01 1.51845072e-01]\n",
" [-1.46001974e-01 -1.81833461e-01 -4.50674605e-01 -1.50060747e-01\n",
" 2.05656124e-01 -4.67298428e-01 -4.94528860e-01 -2.92398371e-01\n",
" 3.12336231e-01 -3.00545592e-01 2.54720316e-01 -1.95167427e-01\n",
" -2.32513684e-01 4.13330033e-01 -2.20372220e-01 2.31909134e-01\n",
" 2.74832248e-01 2.20219597e-01 -2.79329722e-01 -3.64932245e-01\n",
" 3.20770029e-01 3.42642121e-01 1.36931556e-01 1.41917857e-01\n",
" -3.18781630e-01 -3.15710810e-01 -3.58910991e-01 3.27090188e-01\n",
" 1.93970597e-01 -3.25871844e-01]\n",
" [ 2.13128591e-01 2.19787941e-01 -3.14151273e-01 2.13589088e-01\n",
" -2.27286630e-01 3.49846690e-01 2.78011106e-01 -2.46884546e-01\n",
" 5.33831482e-01 -4.07943577e-01 3.11943194e-01 1.64441550e-01\n",
" 2.74048140e-01 -3.24466631e-01 2.01778011e-01 -2.48724548e-01\n",
" -1.55868398e-01 -2.75890776e-01 1.75936443e-01 -3.94019039e-01\n",
" 5.81633800e-01 2.90061879e-01 -2.33070942e-01 -2.10975249e-01\n",
" 3.24564966e-01 -3.06204798e-01 3.27286567e-01 -1.85132152e-01\n",
" -1.72386831e-01 2.83913364e-01]\n",
" [ 2.56194626e-01 2.55500283e-01 2.49592250e-01 2.62415055e-01\n",
" 2.51203322e-01 -2.47542727e-01 -2.75317522e-01 2.86856302e-01\n",
" -2.33700819e-01 -2.35906858e-01 -2.60527880e-01 2.36773135e-01\n",
" 2.69364501e-01 -3.03752233e-01 2.85557409e-01 2.80245079e-01\n",
" -2.09514083e-01 -2.49236946e-01 2.71257402e-01 2.44061602e-01\n",
" -2.94985267e-01 2.73357360e-01 2.56393714e-01 3.01487101e-01\n",
" 2.46242601e-01 2.67971613e-01 3.19149047e-01 2.75862673e-01\n",
" -2.61153017e-01 2.67054717e-01]\n",
" [ 1.97815681e-01 2.24746473e-01 -3.66567273e-01 1.91673053e-01\n",
" -2.06809593e-01 -4.99392280e-01 3.80462938e-01 -2.11491203e-01\n",
" -3.63372319e-01 4.54551150e-01 3.24127986e-01 1.79489640e-01\n",
" 2.32512021e-01 4.43201898e-01 2.01472148e-01 -2.46240179e-01\n",
" -2.42811920e-01 -3.21029649e-01 2.36777342e-01 -4.90400184e-02\n",
" -2.75059295e-01 2.50384332e-01 -2.57455185e-01 -2.12198966e-01\n",
" 3.72652066e-01 -3.37492165e-01 3.33667886e-01 -2.52758752e-01\n",
" -2.40226520e-01 2.24947584e-01]\n",
" [-1.79950553e-01 -2.48032866e-01 -3.05338913e-01 -1.63118667e-01\n",
" 1.38743834e-01 -3.65867682e-01 3.03050969e-01 1.85977777e-01\n",
" -4.15268096e-01 -1.99111478e-01 2.57593201e-01 -3.03503759e-01\n",
" -1.53425133e-01 4.88485577e-01 -1.84589681e-01 2.11600393e-01\n",
" -6.61998056e-01 3.26338276e-01 -3.30152440e-01 1.95194114e-01\n",
" -1.96779963e-01 -6.03247441e-01 1.61418079e-01 1.30592467e-01\n",
" 3.21755424e-01 3.61556920e-01 -2.76567502e-01 -3.49290118e-01\n",
" 2.97302443e-01 -1.36239217e-01]\n",
" [ 1.89780747e-01 1.98554771e-01 2.95740371e-01 2.02009874e-01\n",
" -2.82147689e-01 -3.26158623e-01 4.09547381e-01 -2.80803170e-01\n",
" -2.13380613e-01 3.15487101e-01 -3.03249622e-01 2.59595751e-01\n",
" 2.31199227e-01 3.08588062e-01 2.66352060e-01 4.46603235e-01\n",
" -1.88468014e-01 -3.76999358e-01 -3.99053727e-01 -2.88850535e-01\n",
" 3.17743300e-01 2.34783128e-01 4.44143116e-01 -2.61451181e-01\n",
" 4.30367482e-01 3.56662582e-01 -3.18853568e-01 -3.06851730e-01\n",
" 4.04867624e-01 2.18832135e-01]\n",
" [ 2.55556481e-01 2.47583764e-01 1.70187817e-01 2.45803912e-01\n",
" 2.19837279e-01 2.81029813e-01 -2.26201867e-01 3.37611006e-01\n",
" -1.60404568e-01 -2.44470225e-01 -2.12517630e-01 -2.12489587e-01\n",
" 2.92420056e-01 -2.64138041e-01 -1.83725398e-01 2.44172637e-01\n",
" -6.32625924e-02 -3.10257473e-01 -3.44315429e-01 -2.85772311e-01\n",
" 1.65319441e-01 3.03529634e-01 2.27075677e-01 -3.85683428e-01\n",
" 2.06940204e-01 1.76680305e-01 -2.21614813e-01 2.13896875e-01\n",
" 3.38069699e-01 2.96403062e-01]\n",
" [ 5.16402376e-01 4.27872889e-01 1.90930320e-01 -1.26989804e-01\n",
" 8.31389863e-02 2.32890607e-01 -2.44107737e-01 3.48080869e-01\n",
" -2.51465702e-01 -2.64260548e-01 -2.79539894e-01 -2.74218855e-01\n",
" -1.81407030e-01 -2.95351644e-01 -2.03722405e-01 2.14071856e-01\n",
" 7.23627406e-01 3.49313567e-01 -3.57485465e-01 1.88262303e-01\n",
" 5.42320039e-01 -3.52495219e-01 3.04240532e-01 1.77799212e-01\n",
" -2.14149303e-01 3.90284232e-01 -1.90312948e-01 1.88841894e-01\n",
" 3.58570981e-01 -1.30959378e-01]\n",
" [ 4.00978905e-03 1.72006614e-02 -1.63959053e-02 5.52320537e-02\n",
" -4.51654126e-02 7.42416086e-02 -1.89240016e-02 1.45234827e-01\n",
" 1.09010019e-01 3.45663759e-02 -2.69616213e-02 -9.90824282e-02\n",
" 6.66673751e-02 -8.75108241e-03 6.75106251e-03 -6.72583590e-02\n",
" 1.21721687e-01 -7.31974446e-02 -1.44208544e-01 -5.53949358e-02\n",
" -5.68551250e-03 3.01241934e-02 -9.00143806e-02 -1.46264483e-01\n",
" -1.44289082e-02 -2.33006392e-02 7.28759549e-03 7.49709164e-02\n",
" 9.83959534e-02 1.14028151e-01]\n",
" [-3.66739804e-01 -4.05306658e-01 2.04204574e-01 -1.88858044e-01\n",
" 1.76861340e-01 2.42516436e-01 -3.31574887e-01 2.32031054e-01\n",
" -3.83822065e-01 -3.30483908e-01 -3.90078001e-01 2.98717232e-01\n",
" -1.70419512e-01 -2.33273104e-01 -1.99870347e-01 3.60408320e-01\n",
" 2.58246314e-01 -2.77204243e-01 2.86147968e-01 1.43067288e-01\n",
" 3.20504496e-01 -2.13066989e-01 -3.07630948e-01 1.52211344e-01\n",
" -4.21533191e-01 -2.91201727e-01 -1.87455495e-01 2.24276142e-01\n",
" -3.24798158e-01 -1.64526693e-01]\n",
" [ 3.87872905e-01 4.56999355e-01 1.89952186e-01 -2.10264670e-01\n",
" 2.58816225e-01 2.56110704e-01 -2.26932760e-01 2.93086384e-01\n",
" -1.92678064e-01 4.01935354e-01 -2.37668613e-01 2.53594566e-01\n",
" -1.86458745e-01 -2.12479060e-01 -2.44815472e-01 -4.59255598e-01\n",
" 2.78115442e-01 -3.18436282e-01 1.26527604e-01 1.44363223e-01\n",
" 2.67196273e-01 -2.08769761e-01 -3.00349958e-01 2.31856483e-01\n",
" -2.15769365e-01 -3.20518376e-01 -1.92530829e-01 2.47185279e-01\n",
" -1.81654271e-01 -2.02605887e-01]]\n",
"float64\n",
"[1800, 600, 300, 30, 31]\n"
]
}
],
"source": [
"# SHOW STATS\n",
"\n",
"mlp.prepare(force=True)\n",
"e=mlp.get_expected_output()\n",
"print(e)\n",
"print(np.sum(e))\n",
"print(range_weighted_sum(e))\n",
"mlp.compute_outputs()\n",
"o = mlp.get_output()#[:,:5]\n",
"print(\"out={}\".format(o))\n",
"print(\"alleq? =\",all_axis_equal(o))\n",
"print(\"eq? =\",axis_equal(o))\n",
"h = output_to_hard(o)\n",
"print(\"hout={}\".format(h))\n",
"print(range_weighted_sum(h))\n",
"print(\"alleq? =\",all_axis_equal(h))\n",
"e = mlp.get_expected_output()#[:,:5]\n",
"print(\"expout={}\".format(e))\n",
"print(range_weighted_sum(e))\n",
"print(\"nb errors={}\".format(count_errors(h, e)))\n",
"#print(mlp.get_weights())\n",
"i = mlp.get_input()\n",
"print(range_weighted_sum(i))\n",
"print(\"ieq? =\",axis_equal(i))\n",
"print(\"i? =\",i)\n",
"print(\"diff exp=\", np.sum(e,axis=1))\n",
"W=mlp.get_weights()\n",
"ln=[]\n",
"for w in W:\n",
" print(w)\n",
" ln.append(len(w))\n",
" print(w.dtype)\n",
"print(ln)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"weights_0-815_2018-01-24_14:25:45.params\n",
"[540000, 1080000, 180000, 9000, 930]\n",
"14479464\n",
"True\n",
"bias_0-815_2018-01-24_14:25:45.params\n",
"[1800, 600, 300, 30, 31]\n",
"22112\n",
"True\n"
]
}
],
"source": [
"# SAVE FEATURES\n",
"import datetime\n",
"\n",
"tm = str(datetime.datetime.now()).replace(\" \", \"_\").split(\".\")[0]\n",
"h = output_to_hard(o)\n",
"e = mlp.get_expected_output()\n",
"err = count_errors(h, e)\n",
"\n",
"name = \"weights_\"+str(err)+\"-815_\" + tm + \".params\"\n",
"print(name)\n",
"res = mlp.save_weights(name)\n",
"print(res)\n",
"\n",
"name = \"bias_\"+str(err)+\"-815_\" + tm + \".params\"\n",
"print(name)\n",
"res = mlp.save_bias(name)\n",
"print(res)\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[array([[-0.04057058, 0.0651853 , -0.01361134, ..., -0.08432194,\n",
" -0.08524303, 0.01243363],\n",
" [-0.00286033, 0.12115291, 0.09767998, ..., -0.00536564,\n",
" -0.05191855, -0.02886238],\n",
" [ 0.04904284, -0.07196302, -0.011977 , ..., -0.01733713,\n",
" -0.02678482, -0.01814325],\n",
" ...,\n",
" [ 0.00394269, -0.0310804 , 0.02376524, ..., -0.0601834 ,\n",
" -0.01638902, -0.05306143],\n",
" [-0.01504806, 0.02644431, 0.00124966, ..., -0.05542552,\n",
" 0.00306502, -0.01145775],\n",
" [ 0.00036982, -0.01023131, -0.02188288, ..., 0.04519798,\n",
" 0.09076506, 0.07051898]]), array([[-0.05250401, -0.08025294, 0.06132811, ..., 0.0405196 ,\n",
" -0.01162708, 0.03672399],\n",
" [ 0.09482913, 0.00679376, -0.03453199, ..., 0.02318048,\n",
" -0.05202014, -0.08659085],\n",
" [ 0.04236078, 0.03640715, -0.05303196, ..., -0.02014327,\n",
" -0.03987304, -0.00654301],\n",
" ...,\n",
" [-0.0842528 , -0.07436639, 0.03113683, ..., -0.01078837,\n",
" 0.00892173, 0.05104199],\n",
" [ 0.0030353 , 0.06464886, 0.00414398, ..., -0.02579914,\n",
" 0.04410472, -0.0385331 ],\n",
" [-0.01009386, -0.03736783, -0.01091777, ..., -0.01303171,\n",
" -0.0384781 , 0.02204992]]), array([[ 0.11061017, 0.0420736 , -0.04642054, ..., -0.07134354,\n",
" -0.03904634, -0.01886542],\n",
" [ 0.04064045, -0.04554107, -0.07069191, ..., 0.06552462,\n",
" 0.07950895, 0.00872621],\n",
" [-0.03146787, 0.05169459, -0.01455458, ..., 0.04899692,\n",
" 0.036003 , 0.00135215],\n",
" ...,\n",
" [ 0.04261361, -0.05432634, 0.01165223, ..., 0.02563088,\n",
" 0.03101841, -0.00810351],\n",
" [-0.06358307, -0.03166734, 0.14649339, ..., -0.06680764,\n",
" 0.06550367, 0.03018188],\n",
" [-0.05601524, 0.0246683 , 0.00018749, ..., -0.05908162,\n",
" -0.04142182, 0.01382154]]), array([[-0.02762126, 0.15890358, -0.02989871, ..., -0.0829157 ,\n",
" 0.05174366, -0.05561284],\n",
" [-0.15735023, -0.15949128, 0.03114682, ..., 0.06222333,\n",
" -0.17313786, 0.00764474],\n",
" [ 0.01382 , -0.0176754 , 0.0012808 , ..., 0.0462353 ,\n",
" -0.0018297 , 0.12981864],\n",
" ...,\n",
" [ 0.03184086, 0.10902008, -0.09454381, ..., -0.00361243,\n",
" 0.03193602, -0.03649373],\n",
" [ 0.10149575, 0.0782519 , -0.09373522, ..., 0.08087716,\n",
" 0.01729115, 0.07176767],\n",
" [ 0.02119645, -0.081914 , 0.17181034, ..., -0.02136329,\n",
" -0.09641983, 0.03086602]]), array([[ 0.1907328 , 0.18845196, -0.12224441, -0.05964109, 0.12367525,\n",
" -0.14402297, 0.11241219, -0.13761712, -0.14355683, -0.19991072,\n",
" 0.17114651, 0.14952979, -0.15596192, -0.15104949, -0.23011689,\n",
" -0.15934663, 0.26955059, 0.12671634, -0.24147539, 0.09565542,\n",
" 0.15679567, -0.12698284, -0.14428198, -0.12377838, -0.14584396,\n",
" 0.20000168, 0.11843919, 0.1480444 , -0.10038054, -0.19976624],\n",
" [-0.26594002, 0.24584459, -0.18039047, 0.15171004, 0.20866433,\n",
" 0.22284714, 0.16988576, -0.19359829, -0.23692458, 0.23815787,\n",
" -0.24761103, 0.21239668, 0.22052156, -0.20040023, 0.22730025,\n",
" -0.21014211, 0.19981055, 0.19265382, -0.24858026, 0.17936175,\n",
" -0.21152444, -0.18768684, -0.18730713, -0.2318144 , -0.22607281,\n",
" -0.25467438, 0.19574515, 0.21314958, -0.17710156, -0.21450085],\n",
" [-0.25615497, -0.19865084, -0.20528219, 0.21217482, 0.19610866,\n",
" -0.24527752, 0.18374664, -0.20198927, 0.21765273, -0.24950495,\n",
" 0.20526937, 0.2217967 , -0.20025442, -0.21887354, -0.20594999,\n",
" -0.19181317, -0.1639516 , 0.154928 , 0.17484602, 0.17860372,\n",
" 0.24819725, -0.18159039, -0.19416877, -0.19785529, -0.23132332,\n",
" -0.20847492, 0.18232355, 0.22824306, -0.18691723, -0.23293103],\n",
" [ 0.19472992, 0.16533858, -0.15963799, -0.18106074, 0.10123149,\n",
" 0.14237273, 0.07513196, -0.03270703, -0.10656724, -0.23463651,\n",
" 0.15565149, 0.15875073, -0.16138707, -0.15227946, -0.20782596,\n",
" -0.16188313, -0.23936766, 0.07554376, -0.12082848, 0.0511624 ,\n",
" 0.08963224, -0.11438051, -0.1254928 , -0.00549724, -0.14007508,\n",
" 0.17932819, 0.11322132, 0.13622499, -0.11977518, -0.08605742],\n",
" [ 0.21137036, 0.16977975, -0.14861876, 0.19382205, 0.17887821,\n",
" -0.19236291, 0.13210304, -0.15731299, -0.16763513, -0.21103014,\n",
" 0.16214318, 0.16514125, -0.17850148, -0.17187628, -0.21351516,\n",
" -0.14518994, -0.09725853, 0.1434566 , -0.1324925 , 0.10728972,\n",
" 0.18440369, -0.13522509, -0.1524557 , -0.16699473, -0.17502949,\n",
" 0.19349478, 0.1423498 , 0.1731691 , -0.11229991, -0.21206251],\n",
" [ 0.12195248, 0.10241038, -0.10367074, -0.05472222, 0.01144459,\n",
" 0.0166204 , 0.09638881, -0.08526092, -0.09770319, -0.11627265,\n",
" 0.09582335, 0.12626977, -0.10243554, -0.11886656, -0.13740106,\n",
" -0.05767998, -0.16101139, 0.10154252, -0.08185051, 0.04870284,\n",
" 0.09993 , -0.07882295, -0.0869228 , 0.04811999, -0.10613874,\n",
" 0.12802619, 0.06396679, 0.10684346, -0.05206837, -0.12849488],\n",
" [ 0.08656625, 0.09071858, -0.11948021, 0.03779479, 0.02079479,\n",
" 0.0379051 , 0.08068836, -0.09783856, -0.05666694, -0.10606728,\n",
" 0.10557745, 0.13188151, -0.1104979 , -0.09741735, -0.17654707,\n",
" -0.05717396, 0.09927688, 0.0968594 , -0.14976854, 0.02986896,\n",
" -0.00643134, -0.07775161, -0.12088278, 0.01849153, -0.09181426,\n",
" 0.06135522, 0.03427657, 0.10717171, -0.08853887, -0.14552713],\n",
" [ 0.11740736, 0.11235667, -0.12252784, -0.07941132, -0.13795959,\n",
" -0.05622596, 0.06639817, -0.05201894, -0.10426249, -0.16277948,\n",
" 0.11576816, 0.10638292, -0.11806386, -0.12976171, -0.17514634,\n",
" -0.05916817, 0.04886434, 0.09867757, -0.15749694, -0.01074741,\n",
" 0.05367458, -0.07634598, -0.12029428, -0.00167797, -0.13584242,\n",
" 0.10335138, -0.05427742, 0.11941579, -0.07177931, -0.15643634],\n",
" [ 0.17595935, -0.20609675, -0.18143248, 0.20202628, 0.2258074 ,\n",
" 0.23324888, 0.20565947, -0.17898123, -0.19707043, 0.21328099,\n",
" -0.19241915, -0.23998225, 0.18609225, -0.22031085, 0.21510215,\n",
" 0.21189783, 0.20304097, -0.21196697, 0.20114608, 0.20220369,\n",
" -0.22486312, 0.20355904, 0.23241498, 0.21094049, 0.25270852,\n",
" 0.18300853, 0.21338279, -0.22487285, 0.18570458, -0.21601711],\n",
" [ 0.16426065, 0.24864853, -0.15571289, -0.17283897, -0.24625815,\n",
" -0.14915066, 0.14764493, -0.15897913, -0.16317202, -0.1866881 ,\n",
" 0.23435393, 0.15669011, -0.22181878, -0.15380664, 0.05829437,\n",
" 0.1368447 , 0.09863624, 0.15981646, -0.26349993, 0.14259404,\n",
" 0.14901409, -0.18159128, -0.14006383, 0.21945115, -0.13061565,\n",
" 0.14923529, -0.15280675, 0.16797761, -0.16314103, -0.15339762],\n",
" [-0.20497796, -0.16754841, 0.24178219, 0.2001116 , -0.1793657 ,\n",
" -0.19427466, -0.14013332, 0.16299845, 0.18716269, -0.21014232,\n",
" -0.22724343, -0.28214883, 0.15116052, 0.20427022, 0.20755894,\n",
" 0.21634892, 0.19072303, 0.1423838 , -0.19900561, -0.14328682,\n",
" -0.15372109, 0.13000759, -0.1658216 , -0.30039756, 0.1957482 ,\n",
" -0.23308782, -0.19903931, 0.24974225, 0.28763474, -0.21003888],\n",
" [-0.25506614, -0.19321983, 0.19520065, -0.24451778, -0.1429063 ,\n",
" -0.16494355, -0.169921 , -0.274448 , 0.27525092, 0.25920018,\n",
" -0.15850576, 0.2497452 , 0.18821718, 0.23025386, 0.15638221,\n",
" 0.16852656, -0.26671685, -0.16851117, -0.21910654, -0.19380967,\n",
" -0.26947104, 0.17199281, 0.18467458, 0.19777896, 0.29087537,\n",
" 0.23284929, -0.16447449, -0.19723623, 0.18760104, 0.25985938],\n",
" [-0.21174235, -0.20655813, 0.21226996, 0.20025221, -0.21221078,\n",
" -0.20358154, -0.19415422, 0.22035696, 0.20653507, -0.22851798,\n",
" -0.21568831, -0.22675565, 0.21036629, 0.21108008, 0.21686017,\n",
" 0.20729859, 0.22273732, -0.25619059, -0.22197814, -0.21068322,\n",
" -0.20406842, 0.19442939, 0.2442369 , 0.21345035, 0.22502593,\n",
" -0.24742137, -0.20851847, -0.25795292, 0.22549153, -0.21546929],\n",
" [ 0.16218221, 0.2328384 , -0.1515921 , -0.16540639, -0.26097742,\n",
" -0.14694794, 0.17179765, -0.20794037, -0.12909054, -0.199324 ,\n",
" 0.2029075 , 0.13680517, -0.22604583, -0.16166194, 0.16629779,\n",
" 0.16505158, 0.27203012, 0.18997283, -0.24068873, 0.15456526,\n",
" 0.18955915, -0.20893271, -0.15394913, 0.22611481, -0.14610592,\n",
" 0.16609924, -0.17452934, 0.14769448, -0.1665387 , -0.21905183],\n",
" [ 0.12793143, 0.10358451, -0.11974823, -0.07082481, -0.12153695,\n",
" -0.03904276, 0.06832945, -0.08350856, -0.10117885, -0.16148915,\n",
" 0.10894323, 0.12112644, -0.11834827, -0.10786552, -0.1321922 ,\n",
" 0.05682548, -0.02311914, 0.11340907, -0.17576706, 0.0296034 ,\n",
" 0.08329146, -0.0867687 , -0.11650399, 0.14119883, -0.13058192,\n",
" 0.11826897, -0.05044192, 0.11489005, -0.08546129, -0.14739331],\n",
" [-0.19574007, 0.19127729, 0.26248003, 0.23440636, 0.1795472 ,\n",
" 0.18106473, 0.21776239, -0.21343952, 0.19511341, 0.24650008,\n",
" 0.1842012 , -0.19195523, -0.19579392, 0.20039746, -0.18651895,\n",
" -0.17731094, -0.25816992, 0.22580006, 0.21233623, 0.21767289,\n",
" 0.26181771, -0.1894634 , 0.2341736 , -0.18892036, 0.20412436,\n",
" -0.1910831 , 0.19686854, -0.18195706, 0.26164865, 0.18180563],\n",
" [-0.19201865, 0.19691479, -0.25851425, 0.21347198, 0.16742095,\n",
" 0.18829225, 0.22924853, -0.23194416, 0.17085646, 0.24018277,\n",
" 0.1785183 , -0.18957899, -0.19103589, 0.21345841, -0.18306562,\n",
" -0.18262232, 0.25513847, 0.21480054, 0.19101232, 0.18572381,\n",
" -0.26942916, -0.19382695, -0.25111218, -0.19079301, 0.20394295,\n",
" -0.19163417, 0.1827297 , -0.22528814, -0.24284794, 0.17557648],\n",
" [ 0.21819745, -0.15993116, 0.20167028, -0.21728075, -0.18854303,\n",
" -0.17105889, -0.20122533, 0.21092387, -0.21591872, 0.22843911,\n",
" -0.18475488, -0.27309067, 0.1826669 , 0.23190809, 0.18134682,\n",
" 0.17678637, 0.28515794, -0.18055569, 0.23177122, -0.15985432,\n",
" 0.21291899, 0.19590387, 0.20673145, 0.1834919 , -0.19018212,\n",
" 0.19019907, -0.16287378, -0.19643127, 0.18461828, 0.22376866],\n",
" [ 0.21167788, -0.1604803 , 0.21951069, -0.17469115, -0.15996937,\n",
" -0.16089493, -0.21127477, 0.24394319, -0.23889769, 0.19655921,\n",
" -0.16398725, 0.28050827, 0.16860756, -0.21501606, 0.14286128,\n",
" 0.14075075, -0.29728241, -0.17714433, -0.22015238, -0.18415704,\n",
" 0.22713752, 0.16542158, 0.20874216, 0.16838574, -0.21514939,\n",
" 0.18801104, -0.15467157, -0.2231831 , 0.16750895, 0.2064657 ],\n",
" [ 0.1996851 , -0.24155722, -0.2578425 , -0.18995297, -0.18941166,\n",
" -0.18599282, 0.2404339 , 0.26356824, -0.17142509, 0.20954472,\n",
" -0.20205125, 0.21403967, 0.23975 , -0.20749248, 0.12315517,\n",
" 0.15968173, 0.26536293, -0.23204245, -0.24622288, 0.2436839 ,\n",
" 0.22332601, -0.2299695 , -0.26495212, 0.16692971, -0.17251154,\n",
" 0.17121524, -0.19326782, 0.22063119, 0.16735783, 0.24038869],\n",
" [ 0.18215249, 0.23550876, -0.22841557, -0.19767606, -0.25002138,\n",
" -0.21694721, 0.19847355, -0.24375172, -0.1898401 , 0.2936732 ,\n",
" -0.08661613, 0.189157 , -0.24300052, -0.19159314, 0.2338246 ,\n",
" 0.23671634, -0.30431972, 0.15083636, 0.28372967, 0.1915271 ,\n",
" 0.19252856, -0.2096086 , -0.21429457, 0.19829573, -0.18744975,\n",
" 0.18686946, -0.21726422, 0.1990251 , -0.23385138, 0.23376095],\n",
" [-0.16487229, 0.21736378, 0.16035093, -0.2516034 , -0.27887578,\n",
" 0.20728775, -0.18037562, 0.20102997, 0.15831404, -0.19790163,\n",
" 0.19092339, -0.1697134 , -0.21007563, 0.1396911 , -0.20122559,\n",
" -0.18298215, -0.22915208, -0.20106209, -0.26989745, -0.27279542,\n",
" -0.16738536, 0.22034288, 0.17097415, -0.20099698, 0.16368292,\n",
" -0.16136864, -0.24297259, -0.17211456, -0.1929739 , 0.2236316 ],\n",
" [-0.15905729, -0.24250095, 0.18394737, 0.21452204, 0.24027111,\n",
" 0.23417546, -0.20678908, 0.23851135, 0.1442595 , -0.20471045,\n",
" 0.20437609, -0.14158635, 0.26378855, 0.16150167, -0.22829262,\n",
" -0.22156588, 0.2308239 , -0.19722222, 0.24795137, -0.23251672,\n",
" -0.18102752, 0.23641158, 0.19912975, -0.24198679, 0.1537202 ,\n",
" -0.17105895, 0.24028409, -0.1952164 , 0.27605179, -0.24400159],\n",
" [-0.18192654, 0.19760561, 0.22537266, -0.27157467, 0.2327721 ,\n",
" 0.16851414, -0.2538133 , 0.18187381, 0.18786217, -0.24035638,\n",
" 0.1984586 , -0.19881226, -0.19798767, 0.17969084, -0.17242792,\n",
" -0.16451899, -0.22347965, -0.22790095, 0.24528808, 0.21935064,\n",
" -0.19341128, -0.25155042, 0.21707131, -0.18698439, 0.18694626,\n",
" -0.18673402, 0.23241588, -0.1455434 , -0.22167468, 0.18645628],\n",
" [ 0.21809613, -0.17045839, 0.19428934, -0.20044656, -0.16605168,\n",
" -0.16177226, -0.18912845, 0.21428729, -0.20636135, 0.20441315,\n",
" -0.16479735, -0.28455701, 0.16352746, 0.21015725, 0.15652452,\n",
" 0.16374228, -0.31588354, -0.16857391, 0.25224163, -0.17845344,\n",
" 0.23376334, 0.16444704, 0.17320432, 0.16037508, -0.2137657 ,\n",
" 0.19391543, -0.17253873, -0.17968757, 0.18942232, 0.20226475],\n",
" [ 0.22572428, 0.19564087, 0.22078116, -0.21565601, 0.24160951,\n",
" 0.2424269 , -0.21685548, 0.22001859, 0.22129396, -0.22529551,\n",
" 0.19401455, 0.23106438, -0.21681847, -0.22252577, -0.19784479,\n",
" -0.20818945, -0.21218031, 0.22296548, 0.23651593, -0.23888863,\n",
" 0.23688886, 0.14305781, -0.21634886, 0.24054326, -0.20886862,\n",
" 0.22053074, -0.25045919, 0.22342618, -0.18674614, 0.22028996],\n",
" [ 0.16883106, 0.13898946, -0.12126907, -0.13864663, 0.11952522,\n",
" 0.08519253, 0.09527768, -0.1065714 , -0.14117656, -0.19303931,\n",
" 0.1163915 , 0.15651804, -0.12938404, -0.14239816, -0.19665824,\n",
" -0.11031734, -0.19606519, 0.10893486, 0.00922573, -0.00502963,\n",
" 0.12848948, -0.02054687, -0.1333508 , 0.19398733, -0.12925496,\n",
" 0.14675511, 0.10862354, 0.1592537 , -0.0885517 , -0.15028118],\n",
" [ 0.241493 , -0.24655615, -0.15188545, 0.19061559, 0.21384566,\n",
" 0.20164582, 0.12914974, -0.18394987, -0.16967813, 0.14930956,\n",
" -0.18138957, 0.18383737, 0.16361615, -0.16212898, 0.20088115,\n",
" -0.21043134, 0.17839552, 0.2219276 , 0.23283961, 0.14868441,\n",
" -0.15564164, -0.22515652, -0.2051097 , 0.26271525, -0.20704748,\n",
" 0.24795846, 0.18298621, 0.20765366, -0.18310315, -0.19198758],\n",
" [ 0.14603073, -0.01854124, -0.11674552, 0.06004529, -0.11341442,\n",
" -0.05302997, 0.06322247, -0.08001928, -0.11410933, -0.15169671,\n",
" 0.02642597, 0.12328342, -0.0184219 , -0.11712042, -0.07348047,\n",
" 0.04300176, 0.06957878, 0.12580343, -0.16404834, -0.04384091,\n",
" -0.00076468, 0.00969206, -0.11597377, 0.12301344, -0.11180431,\n",
" 0.11889772, -0.02523292, 0.12312133, -0.08818183, -0.16973155],\n",
" [-0.23521606, -0.18611864, -0.28743954, 0.18371157, -0.16944342,\n",
" -0.18737756, -0.16180626, 0.22186599, 0.17371077, -0.20029356,\n",
" -0.21758563, 0.22965642, 0.17428883, -0.19034643, 0.1895514 ,\n",
" 0.19759278, 0.18154441, 0.18761481, -0.18535817, -0.19478933,\n",
" -0.15778567, 0.21502387, -0.18524453, -0.22402376, 0.22325489,\n",
" -0.21401477, -0.21304758, 0.24455513, -0.21886554, -0.21213158],\n",
" [ 0.03010671, -0.17727856, -0.15746903, 0.19191682, -0.27997733,\n",
" -0.1572646 , 0.20692155, -0.20448688, -0.20663719, -0.24647756,\n",
" -0.13208029, 0.17683254, 0.11380687, -0.18777525, 0.11430546,\n",
" 0.14603996, 0.14529346, 0.18639466, -0.21953716, -0.15394316,\n",
" -0.11788935, -0.22867283, -0.16711727, -0.19146617, -0.19404575,\n",
" -0.05522092, 0.16848797, 0.15329358, -0.17279433, -0.17219105]])]\n",
"[array([[-0.04846611],\n",
" [-0.04964174],\n",
" [ 0.05359007],\n",
" ...,\n",
" [-0.01537898],\n",
" [-0.05568209],\n",
" [ 0.0392154 ]]), array([[ 1.75756112e-02],\n",
" [ 2.04182525e-02],\n",
" [ 4.12743583e-03],\n",
" [-4.03501139e-03],\n",
" [ 1.70787622e-02],\n",
" [ 2.01314052e-03],\n",
" [-1.97025792e-02],\n",
" [-5.84516599e-03],\n",
" [-4.14159886e-02],\n",
" [ 2.88752797e-02],\n",
" [ 2.16019355e-03],\n",
" [ 1.86458604e-02],\n",
" [ 1.84439134e-02],\n",
" [-5.92207227e-03],\n",
" [ 1.93448353e-02],\n",
" [ 3.00923944e-02],\n",
" [-3.71364337e-02],\n",
" [-9.20047098e-03],\n",
" [ 1.49428752e-02],\n",
" [-2.21979183e-03],\n",
" [-3.35269675e-05],\n",
" [ 5.78781174e-02],\n",
" [-5.00323968e-02],\n",
" [ 5.25110979e-02],\n",
" [ 3.46565676e-02],\n",
" [ 3.55970251e-03],\n",
" [ 1.92716585e-02],\n",
" [-1.33526832e-02],\n",
" [ 2.83397667e-02],\n",
" [ 1.87451277e-02],\n",
" [-1.68575829e-02],\n",
" [ 2.81266619e-04],\n",
" [-2.49884543e-02],\n",
" [ 2.60431430e-02],\n",
" [-7.45730339e-03],\n",
" [-2.27940731e-02],\n",
" [ 1.80243830e-02],\n",
" [ 2.05508009e-02],\n",
" [ 8.39557903e-03],\n",
" [ 3.91535822e-02],\n",
" [-2.30279232e-02],\n",
" [ 2.51881006e-02],\n",
" [-3.92445660e-03],\n",
" [-1.91722748e-02],\n",
" [ 9.64986925e-03],\n",
" [-2.91603134e-02],\n",
" [ 2.86248543e-02],\n",
" [ 7.96741509e-03],\n",
" [ 2.82894463e-02],\n",
" [ 9.25422978e-03],\n",
" [-2.97846232e-02],\n",
" [ 2.09152682e-02],\n",
" [ 2.55270006e-02],\n",
" [-2.44866619e-02],\n",
" [ 5.16121393e-02],\n",
" [-1.77984632e-02],\n",
" [-2.68996535e-03],\n",
" [ 2.29019105e-02],\n",
" [ 3.87973107e-02],\n",
" [ 1.63155180e-02],\n",
" [ 5.35119288e-02],\n",
" [-2.55533079e-02],\n",
" [ 3.09050114e-03],\n",
" [-2.39368329e-02],\n",
" [ 2.05091789e-03],\n",
" [ 1.92049723e-02],\n",
" [-8.46090367e-03],\n",
" [ 2.86878394e-02],\n",
" [ 1.10627628e-02],\n",
" [ 1.48939313e-02],\n",
" [-2.65319227e-02],\n",
" [-1.79574257e-02],\n",
" [ 2.00279816e-02],\n",
" [ 9.96688109e-03],\n",
" [-1.65257102e-02],\n",
" [-2.87207655e-03],\n",
" [ 5.31139311e-02],\n",
" [-2.69101414e-03],\n",
" [ 3.57282334e-02],\n",
" [-1.32094810e-02],\n",
" [-2.34803906e-02],\n",
" [ 1.18299876e-02],\n",
" [ 1.06327988e-02],\n",
" [-3.14940169e-03],\n",
" [-1.14000723e-02],\n",
" [-2.25782125e-02],\n",
" [-2.71653208e-03],\n",
" [ 2.15951524e-02],\n",
" [-2.08916703e-02],\n",
" [ 1.87911111e-02],\n",
" [ 1.90946083e-02],\n",
" [-2.96383775e-02],\n",
" [-3.26207076e-02],\n",
" [-2.04116992e-03],\n",
" [ 4.31231139e-03],\n",
" [ 1.35534516e-03],\n",
" [-1.52601806e-02],\n",
" [-1.94589817e-02],\n",
" [-4.85493555e-03],\n",
" [ 2.34813217e-02],\n",
" [ 1.95240063e-02],\n",
" [ 7.00935879e-03],\n",
" [ 4.33344384e-02],\n",
" [ 3.60270242e-02],\n",
" [-6.60674573e-04],\n",
" [-2.86890137e-02],\n",
" [ 2.29162525e-02],\n",
" [ 4.51064974e-03],\n",
" [-2.32284449e-02],\n",
" [-2.46491263e-02],\n",
" [ 3.92917792e-03],\n",
" [ 7.05535631e-02],\n",
" [-2.65109885e-02],\n",
" [-1.84674700e-02],\n",
" [ 7.28681752e-03],\n",
" [ 1.58859662e-03],\n",
" [ 2.37755863e-02],\n",
" [-4.78120501e-02],\n",
" [ 3.13649953e-02],\n",
" [-4.60724730e-03],\n",
" [-2.02707873e-02],\n",
" [ 1.87074300e-02],\n",
" [ 4.84559288e-02],\n",
" [ 2.11460553e-02],\n",
" [-3.67323687e-03],\n",
" [ 1.82558351e-02],\n",
" [-3.06363664e-02],\n",
" [-3.35324538e-02],\n",
" [ 5.13314395e-02],\n",
" [ 1.34114201e-02],\n",
" [-1.61825266e-02],\n",
" [ 4.70431351e-03],\n",
" [-3.14738197e-02],\n",
" [ 6.64279984e-03],\n",
" [ 8.31672602e-03],\n",
" [ 2.93731906e-02],\n",
" [ 5.04139218e-02],\n",
" [-5.07041598e-02],\n",
" [ 3.14423960e-02],\n",
" [-7.51099533e-03],\n",
" [-4.34223560e-03],\n",
" [-1.64052312e-02],\n",
" [ 3.60997061e-03],\n",
" [-3.36520361e-02],\n",
" [ 2.74493847e-02],\n",
" [-1.56515927e-02],\n",
" [ 1.53352321e-03],\n",
" [ 1.32893041e-03],\n",
" [-7.44310388e-03],\n",
" [ 2.11861733e-02],\n",
" [ 1.55976052e-02],\n",
" [ 3.31603877e-02],\n",
" [-1.14302578e-02],\n",
" [-2.81853315e-02],\n",
" [ 3.25679427e-02],\n",
" [ 1.40162768e-02],\n",
" [ 4.25808739e-03],\n",
" [ 3.67311287e-02],\n",
" [-3.65472974e-02],\n",
" [-2.99931284e-02],\n",
" [ 2.15771593e-03],\n",
" [ 1.27151569e-02],\n",
" [ 2.45971775e-02],\n",
" [-5.32211500e-03],\n",
" [-1.86406994e-02],\n",
" [ 2.93015847e-02],\n",
" [-2.82863111e-02],\n",
" [-4.72697201e-03],\n",
" [ 3.79429658e-02],\n",
" [-3.87467155e-02],\n",
" [ 3.63085701e-02],\n",
" [-3.10417622e-02],\n",
" [ 3.30170293e-02],\n",
" [ 2.86340095e-02],\n",
" [-1.43689772e-02],\n",
" [ 2.01094889e-03],\n",
" [-1.23412131e-03],\n",
" [-2.67490674e-02],\n",
" [ 1.28026209e-02],\n",
" [ 2.27228363e-02],\n",
" [ 7.26475746e-03],\n",
" [-8.29223370e-03],\n",
" [ 7.22274295e-03],\n",
" [-1.61017081e-02],\n",
" [-7.88848294e-03],\n",
" [-5.64093114e-02],\n",
" [ 1.91346862e-02],\n",
" [-2.21920693e-03],\n",
" [ 2.53592263e-02],\n",
" [ 7.34355791e-04],\n",
" [ 1.03092785e-02],\n",
" [-8.16066571e-03],\n",
" [ 5.31842630e-03],\n",
" [ 2.35771138e-03],\n",
" [-2.45620042e-02],\n",
" [-3.34859054e-02],\n",
" [-2.45833273e-02],\n",
" [ 4.39270904e-03],\n",
" [ 9.32458837e-03],\n",
" [ 3.86225328e-02],\n",
" [ 7.80443085e-03],\n",
" [-1.65746668e-02],\n",
" [-1.89955699e-02],\n",
" [ 1.99624470e-02],\n",
" [ 3.59608458e-03],\n",
" [-4.00393067e-02],\n",
" [-2.30186535e-02],\n",
" [-2.03293672e-03],\n",
" [-2.92686824e-02],\n",
" [-2.33108452e-02],\n",
" [ 5.99909576e-03],\n",
" [ 5.40829206e-02],\n",
" [-1.61265093e-02],\n",
" [-3.70227405e-02],\n",
" [-1.09751881e-02],\n",
" [ 1.01805974e-02],\n",
" [-3.65937063e-02],\n",
" [ 2.53145062e-02],\n",
" [-2.46144953e-02],\n",
" [-1.40802005e-02],\n",
" [ 1.02665019e-02],\n",
" [ 3.13998808e-02],\n",
" [-2.14513557e-02],\n",
" [ 1.38220033e-02],\n",
" [-3.19524810e-03],\n",
" [-2.05644391e-02],\n",
" [ 2.82648792e-04],\n",
" [-6.72310215e-02],\n",
" [-6.44530482e-03],\n",
" [ 2.78144364e-02],\n",
" [ 3.14016585e-02],\n",
" [-3.69193629e-02],\n",
" [-1.81051614e-02],\n",
" [-3.19879577e-02],\n",
" [-9.09258089e-04],\n",
" [-8.53191828e-03],\n",
" [-1.95963122e-02],\n",
" [-2.68933882e-02],\n",
" [-2.73845258e-02],\n",
" [ 1.38972828e-02],\n",
" [ 2.45462663e-02],\n",
" [-3.59691200e-02],\n",
" [-1.29649402e-03],\n",
" [ 8.26376290e-03],\n",
" [-4.29640178e-03],\n",
" [ 2.64849674e-02],\n",
" [-4.81576675e-03],\n",
" [-2.52265739e-02],\n",
" [ 1.87564336e-02],\n",
" [-5.46597306e-03],\n",
" [-1.81280213e-02],\n",
" [-2.16292587e-02],\n",
" [ 8.65311982e-03],\n",
" [ 2.06368399e-02],\n",
" [ 7.23345995e-03],\n",
" [ 2.33602208e-02],\n",
" [-3.51434749e-03],\n",
" [ 2.05927280e-02],\n",
" [ 2.75774934e-02],\n",
" [ 1.12017359e-02],\n",
" [-1.26934432e-02],\n",
" [-4.00744632e-02],\n",
" [ 1.83479811e-02],\n",
" [ 1.03159792e-02],\n",
" [ 2.34406133e-02],\n",
" [-1.49103761e-03],\n",
" [ 4.68648899e-03],\n",
" [ 1.94587584e-02],\n",
" [ 1.45348705e-02],\n",
" [-2.41346612e-02],\n",
" [-3.70597888e-02],\n",
" [-4.41622378e-02],\n",
" [ 2.52089188e-02],\n",
" [-2.06488966e-02],\n",
" [-8.88229282e-03],\n",
" [-1.12506698e-03],\n",
" [-1.46026086e-02],\n",
" [ 2.49637653e-02],\n",
" [-2.52330107e-03],\n",
" [-6.78117120e-03],\n",
" [-3.43049175e-03],\n",
" [ 4.65300256e-02],\n",
" [-1.76204391e-02],\n",
" [ 2.22446296e-02],\n",
" [ 1.37603992e-02],\n",
" [-2.06215255e-02],\n",
" [ 3.62787958e-03],\n",
" [-5.48660347e-03],\n",
" [-6.82821938e-02],\n",
" [ 1.45133476e-02],\n",
" [-1.10804896e-02],\n",
" [-7.13397903e-03],\n",
" [-2.17168406e-02],\n",
" [-2.25789929e-02],\n",
" [ 1.04630162e-02],\n",
" [-1.88386793e-02],\n",
" [ 3.56123926e-02],\n",
" [-1.52176080e-02],\n",
" [-1.07955750e-02],\n",
" [ 2.32043616e-02],\n",
" [ 1.15858865e-03],\n",
" [-1.69390720e-03],\n",
" [-1.45178325e-02],\n",
" [ 1.22052382e-02],\n",
" [-2.29130756e-03],\n",
" [-1.12019013e-02],\n",
" [-5.69167268e-03],\n",
" [ 7.49765617e-03],\n",
" [-6.80123007e-03],\n",
" [-5.26588241e-02],\n",
" [-1.16878871e-02],\n",
" [-2.11761711e-03],\n",
" [ 2.52402992e-03],\n",
" [ 2.35264345e-02],\n",
" [ 4.02698916e-02],\n",
" [-2.69764380e-02],\n",
" [-4.12857400e-03],\n",
" [ 6.61398711e-03],\n",
" [ 2.11827710e-02],\n",
" [ 1.85839992e-02],\n",
" [ 3.11514882e-04],\n",
" [ 1.11406757e-04],\n",
" [ 4.90033292e-03],\n",
" [-4.45343562e-02],\n",
" [-6.62955352e-03],\n",
" [-4.87850992e-03],\n",
" [-3.69156509e-03],\n",
" [-3.44328118e-02],\n",
" [ 2.79314023e-03],\n",
" [-2.99629113e-02],\n",
" [ 2.58312151e-02],\n",
" [-3.53997609e-03],\n",
" [-3.84928332e-02],\n",
" [ 3.06395086e-02],\n",
" [-2.99766983e-02],\n",
" [ 8.59291660e-02],\n",
" [ 1.79236448e-03],\n",
" [ 2.07668720e-02],\n",
" [-3.61858427e-02],\n",
" [-1.58013954e-03],\n",
" [-4.65349450e-02],\n",
" [-2.38615312e-03],\n",
" [-2.21568125e-02],\n",
" [ 2.33169227e-02],\n",
" [-8.32886522e-03],\n",
" [-2.19225187e-02],\n",
" [ 1.73917479e-02],\n",
" [-4.18897156e-02],\n",
" [ 2.67794354e-02],\n",
" [-8.84602473e-03],\n",
" [ 1.97893799e-02],\n",
" [-2.98126296e-02],\n",
" [-5.72401155e-03],\n",
" [-2.20768105e-02],\n",
" [ 2.64037591e-02],\n",
" [-1.73706494e-02],\n",
" [ 2.09647091e-02],\n",
" [-1.15467493e-02],\n",
" [ 1.20792155e-03],\n",
" [-2.11164938e-03],\n",
" [-1.12125092e-02],\n",
" [ 1.76250031e-02],\n",
" [-7.22060011e-03],\n",
" [ 2.38298659e-02],\n",
" [-6.40042825e-03],\n",
" [-1.78614899e-02],\n",
" [-8.04581879e-04],\n",
" [-2.24200382e-02],\n",
" [-1.17976372e-02],\n",
" [ 3.18620454e-03],\n",
" [ 7.95273065e-04],\n",
" [ 7.65261963e-03],\n",
" [ 1.61255905e-03],\n",
" [ 9.11085540e-03],\n",
" [ 9.56004704e-03],\n",
" [-1.91476022e-02],\n",
" [ 1.76168000e-02],\n",
" [-2.62705740e-03],\n",
" [ 5.32042836e-03],\n",
" [-6.40704568e-03],\n",
" [ 2.55064150e-02],\n",
" [-4.55316491e-02],\n",
" [-2.12921092e-03],\n",
" [-5.64549772e-06],\n",
" [ 9.92659949e-03],\n",
" [ 1.51512217e-02],\n",
" [-1.06001623e-03],\n",
" [ 7.11928346e-03],\n",
" [ 5.14853512e-02],\n",
" [ 1.83121639e-02],\n",
" [-7.19094961e-02],\n",
" [ 9.45611711e-03],\n",
" [ 3.27686267e-02],\n",
" [ 2.38465814e-02],\n",
" [-1.02791789e-02],\n",
" [-2.28376864e-02],\n",
" [ 3.37208794e-02],\n",
" [ 3.65540605e-03],\n",
" [-4.31368110e-03],\n",
" [ 2.39309286e-02],\n",
" [-1.94026472e-02],\n",
" [ 2.82416465e-02],\n",
" [-2.27071100e-02],\n",
" [-1.01173117e-02],\n",
" [-7.61136567e-03],\n",
" [-2.34931305e-02],\n",
" [-1.28354609e-02],\n",
" [-3.21093727e-02],\n",
" [ 1.36443646e-02],\n",
" [ 1.55799305e-02],\n",
" [-1.90314582e-02],\n",
" [ 1.80162355e-02],\n",
" [ 2.83893075e-02],\n",
" [ 2.25070972e-02],\n",
" [-1.86625927e-02],\n",
" [ 4.01578696e-02],\n",
" [ 4.16208803e-02],\n",
" [-1.64825856e-02],\n",
" [ 1.64384379e-02],\n",
" [ 1.24869929e-02],\n",
" [-1.83981377e-02],\n",
" [ 2.77067207e-02],\n",
" [ 8.63180844e-03],\n",
" [-9.58461248e-03],\n",
" [-2.53791210e-03],\n",
" [ 1.20823472e-02],\n",
" [ 2.00576408e-02],\n",
" [-3.42745678e-02],\n",
" [-6.15264880e-03],\n",
" [-1.30638143e-02],\n",
" [-5.90847355e-02],\n",
" [-2.00124071e-02],\n",
" [ 3.94243469e-03],\n",
" [-6.17840460e-03],\n",
" [ 6.47084422e-03],\n",
" [ 1.99312467e-02],\n",
" [-3.70277079e-03],\n",
" [ 3.24642441e-02],\n",
" [ 3.29149579e-02],\n",
" [ 3.99071860e-04],\n",
" [-4.16078105e-02],\n",
" [ 2.23077026e-02],\n",
" [-1.59971066e-02],\n",
" [-6.81504760e-03],\n",
" [-6.01759879e-03],\n",
" [ 2.81279602e-02],\n",
" [ 6.10086085e-02],\n",
" [ 4.83727542e-03],\n",
" [ 1.27795750e-02],\n",
" [ 2.80799684e-02],\n",
" [ 5.00537258e-02],\n",
" [-1.35472832e-02],\n",
" [-5.07766715e-04],\n",
" [ 2.95761239e-02],\n",
" [ 6.88277979e-02],\n",
" [-5.48122906e-03],\n",
" [-2.39621422e-02],\n",
" [ 8.12782772e-03],\n",
" [-2.78899796e-03],\n",
" [-2.38922554e-02],\n",
" [ 4.83087238e-02],\n",
" [-1.60127411e-02],\n",
" [-5.08570168e-04],\n",
" [-7.40572649e-03],\n",
" [-2.39027653e-02],\n",
" [-1.43742040e-02],\n",
" [ 1.60416548e-02],\n",
" [ 1.91552282e-02],\n",
" [ 1.21520976e-02],\n",
" [-3.58369858e-02],\n",
" [ 3.10432079e-02],\n",
" [-1.18561132e-02],\n",
" [ 2.04218321e-02],\n",
" [ 2.71987292e-02],\n",
" [-2.06255513e-02],\n",
" [ 2.37607497e-02],\n",
" [-9.66372114e-02],\n",
" [ 2.45842214e-02],\n",
" [ 1.74269686e-02],\n",
" [-7.14823852e-02],\n",
" [-1.56388942e-02],\n",
" [-1.73886629e-02],\n",
" [ 7.90299770e-05],\n",
" [-3.78200199e-03],\n",
" [-5.91347357e-02],\n",
" [ 4.89278786e-03],\n",
" [ 1.74365816e-02],\n",
" [ 2.46553403e-02],\n",
" [-1.73623089e-02],\n",
" [ 6.93371592e-03],\n",
" [ 1.86197364e-02],\n",
" [-1.70149390e-02],\n",
" [-2.09023316e-02],\n",
" [ 7.48604579e-03],\n",
" [ 4.12977148e-02],\n",
" [-1.17524633e-02],\n",
" [ 2.73902404e-03],\n",
" [ 1.30311459e-03],\n",
" [-7.67690052e-03],\n",
" [ 2.45318680e-02],\n",
" [ 2.90422234e-02],\n",
" [-9.92625995e-03],\n",
" [-2.33534214e-02],\n",
" [ 2.34703394e-02],\n",
" [ 7.31076017e-03],\n",
" [ 3.92257648e-02],\n",
" [ 2.00077584e-02],\n",
" [-2.22877249e-02],\n",
" [-4.70377214e-03],\n",
" [-1.60410133e-02],\n",
" [-3.88202775e-02],\n",
" [ 2.00055003e-02],\n",
" [-1.57081156e-02],\n",
" [ 4.96295138e-02],\n",
" [ 5.27412603e-03],\n",
" [ 1.44900413e-02],\n",
" [ 1.52035816e-03],\n",
" [ 1.04590787e-02],\n",
" [-1.27174410e-02],\n",
" [-1.27062697e-02],\n",
" [-2.47312584e-02],\n",
" [-5.46189675e-03],\n",
" [-1.11128760e-02],\n",
" [-2.88804396e-04],\n",
" [-1.12680899e-02],\n",
" [ 1.20104991e-02],\n",
" [-2.90428509e-02],\n",
" [ 1.11240504e-02],\n",
" [-1.51455378e-02],\n",
" [ 1.22908503e-03],\n",
" [-3.24554796e-02],\n",
" [-1.24319487e-04],\n",
" [-6.69850302e-03],\n",
" [-2.43887167e-02],\n",
" [ 3.24296274e-02],\n",
" [ 4.12166266e-02],\n",
" [-1.95243972e-02],\n",
" [-2.43649165e-02],\n",
" [ 3.25305096e-02],\n",
" [ 1.63693726e-02],\n",
" [ 1.61266815e-02],\n",
" [-4.28627655e-02],\n",
" [-2.93948356e-02],\n",
" [-4.61409280e-03],\n",
" [ 6.79405742e-03],\n",
" [-3.86272615e-03],\n",
" [-1.69203783e-03],\n",
" [ 1.13857154e-02],\n",
" [-1.66042552e-02],\n",
" [-1.66380988e-02],\n",
" [ 1.89680518e-02],\n",
" [ 2.01367281e-02],\n",
" [-2.27644043e-02],\n",
" [-1.12287899e-02],\n",
" [-3.23130733e-04],\n",
" [-1.07827647e-02],\n",
" [ 8.02841544e-03],\n",
" [-8.71656137e-03],\n",
" [-2.52336119e-02],\n",
" [ 8.65599862e-03],\n",
" [ 1.05931100e-02],\n",
" [ 2.80799690e-02],\n",
" [-2.82971017e-02],\n",
" [ 1.77435499e-02],\n",
" [ 6.92332531e-03],\n",
" [ 2.66769083e-02],\n",
" [-5.61462970e-03],\n",
" [ 3.99426882e-03],\n",
" [ 2.21242617e-02],\n",
" [ 3.59846977e-03],\n",
" [-2.65067703e-02],\n",
" [-3.06645263e-02],\n",
" [ 1.50708088e-02],\n",
" [ 6.32014491e-03],\n",
" [ 1.44999272e-02],\n",
" [-2.89086592e-03],\n",
" [ 1.07007568e-02],\n",
" [-3.67309789e-02],\n",
" [-2.17517220e-02],\n",
" [ 3.32429758e-02],\n",
" [ 1.95256200e-02],\n",
" [ 1.49965842e-03],\n",
" [-1.35060096e-02],\n",
" [-3.03060006e-02],\n",
" [ 1.17423278e-02],\n",
" [ 1.60729416e-02],\n",
" [ 4.68263191e-03],\n",
" [ 8.43515417e-03],\n",
" [ 1.06477922e-02],\n",
" [-1.44629828e-02],\n",
" [-2.13470923e-02],\n",
" [-9.72381234e-03],\n",
" [ 4.42189194e-02],\n",
" [-2.77174969e-02],\n",
" [-2.08965367e-02],\n",
" [-3.43601972e-02],\n",
" [ 6.29491396e-03],\n",
" [-3.34189940e-03],\n",
" [-1.84664669e-02],\n",
" [-1.03655723e-02]]), array([[ 2.50142841e-02],\n",
" [-3.42758937e-02],\n",
" [ 3.47441569e-02],\n",
" [ 1.43971638e-02],\n",
" [-1.26606545e-02],\n",
" [-2.61136873e-02],\n",
" [-7.78988354e-03],\n",
" [ 6.08938412e-02],\n",
" [ 5.29444070e-03],\n",
" [-4.84117763e-02],\n",
" [ 1.86303642e-02],\n",
" [ 1.06036627e-02],\n",
" [-1.07456643e-02],\n",
" [-3.82212816e-03],\n",
" [-6.17120484e-03],\n",
" [-4.47772624e-02],\n",
" [-1.12310134e-02],\n",
" [ 4.46878323e-03],\n",
" [ 3.48909093e-02],\n",
" [ 8.42303283e-04],\n",
" [ 9.71441246e-03],\n",
" [ 2.22324403e-02],\n",
" [-2.08973383e-02],\n",
" [-2.21027358e-02],\n",
" [ 5.75952836e-02],\n",
" [ 4.64969758e-02],\n",
" [-3.82189167e-03],\n",
" [-2.71391759e-02],\n",
" [-2.21877164e-02],\n",
" [-5.60614984e-02],\n",
" [ 1.50505270e-02],\n",
" [ 3.11705193e-02],\n",
" [ 1.65792504e-02],\n",
" [ 5.78586025e-03],\n",
" [ 9.76214755e-03],\n",
" [ 4.81972819e-03],\n",
" [-9.92064251e-03],\n",
" [ 1.85115011e-02],\n",
" [-9.28667732e-03],\n",
" [-2.17725955e-02],\n",
" [-2.51531049e-02],\n",
" [-3.01849926e-02],\n",
" [-2.26862040e-02],\n",
" [-4.97510220e-02],\n",
" [-2.34395793e-02],\n",
" [ 2.26315297e-02],\n",
" [-2.43309024e-02],\n",
" [-2.79272320e-02],\n",
" [-3.29656171e-02],\n",
" [-2.82127741e-03],\n",
" [-3.02305875e-02],\n",
" [ 2.68345039e-02],\n",
" [ 4.30939710e-03],\n",
" [ 1.32394584e-02],\n",
" [-5.00781347e-03],\n",
" [-2.27484866e-02],\n",
" [ 4.37854548e-02],\n",
" [-3.91910172e-02],\n",
" [ 2.09623550e-02],\n",
" [-4.34768464e-02],\n",
" [ 1.86355975e-02],\n",
" [ 1.54658519e-02],\n",
" [ 1.18274559e-02],\n",
" [ 1.99711654e-02],\n",
" [-3.62118827e-02],\n",
" [-2.77084250e-02],\n",
" [ 2.30781028e-02],\n",
" [-4.44421366e-02],\n",
" [ 1.07989880e-02],\n",
" [ 4.42895438e-02],\n",
" [-5.67431216e-03],\n",
" [-8.70466807e-03],\n",
" [ 1.41204969e-02],\n",
" [-6.41355137e-02],\n",
" [ 1.48231473e-02],\n",
" [-7.77996714e-03],\n",
" [ 2.48436309e-02],\n",
" [ 5.79119519e-03],\n",
" [ 2.84736813e-02],\n",
" [-3.43402145e-02],\n",
" [ 2.02125028e-02],\n",
" [-6.87171455e-03],\n",
" [ 5.59207502e-03],\n",
" [ 1.30518197e-02],\n",
" [ 1.58844570e-02],\n",
" [ 2.76113680e-03],\n",
" [ 1.96706636e-02],\n",
" [ 2.98303830e-02],\n",
" [-3.69430840e-04],\n",
" [-5.08525814e-02],\n",
" [ 2.07354565e-02],\n",
" [-3.14961819e-02],\n",
" [ 2.22486117e-02],\n",
" [ 1.52345855e-02],\n",
" [-5.88869486e-03],\n",
" [-2.55543844e-02],\n",
" [ 1.60482182e-03],\n",
" [-1.55155469e-02],\n",
" [ 2.19796439e-02],\n",
" [-5.82650544e-03],\n",
" [-4.78927712e-02],\n",
" [ 8.56248875e-03],\n",
" [-3.91148646e-02],\n",
" [ 5.61986869e-03],\n",
" [-4.42777540e-02],\n",
" [-6.28538068e-03],\n",
" [ 1.10476759e-02],\n",
" [-2.38015368e-02],\n",
" [ 3.69273020e-02],\n",
" [ 2.37568665e-02],\n",
" [-2.01641023e-02],\n",
" [ 7.19961377e-03],\n",
" [-1.51841599e-02],\n",
" [-3.43610756e-03],\n",
" [ 1.66602301e-02],\n",
" [-2.77577567e-02],\n",
" [ 1.60050159e-02],\n",
" [-1.96514651e-02],\n",
" [ 2.82074387e-02],\n",
" [ 3.13691947e-02],\n",
" [ 1.17060522e-04],\n",
" [ 3.60677391e-03],\n",
" [-2.62871500e-02],\n",
" [ 6.56603766e-02],\n",
" [-2.08965112e-02],\n",
" [ 5.97987059e-02],\n",
" [ 1.63352782e-03],\n",
" [-8.11536012e-03],\n",
" [-2.95699881e-02],\n",
" [ 1.13097714e-02],\n",
" [-1.73590949e-02],\n",
" [-1.47885913e-02],\n",
" [ 2.66208700e-02],\n",
" [-3.61075127e-04],\n",
" [ 4.61225419e-02],\n",
" [ 9.32277038e-05],\n",
" [ 4.77358721e-03],\n",
" [-2.64604621e-02],\n",
" [ 2.02094721e-02],\n",
" [-1.70998605e-02],\n",
" [-1.72628309e-02],\n",
" [ 5.71683199e-03],\n",
" [-3.03408734e-02],\n",
" [ 7.79906981e-03],\n",
" [ 6.14099470e-03],\n",
" [ 1.76521602e-02],\n",
" [-9.49668592e-04],\n",
" [ 1.72923577e-02],\n",
" [ 7.23097523e-02],\n",
" [-4.73678492e-03],\n",
" [-2.43547135e-02],\n",
" [ 4.93013460e-02],\n",
" [-5.10913049e-02],\n",
" [-6.32001109e-02],\n",
" [ 2.79541214e-02],\n",
" [ 3.55160291e-02],\n",
" [ 7.67223823e-03],\n",
" [ 4.44109208e-02],\n",
" [-2.30431742e-02],\n",
" [-3.44067780e-02],\n",
" [ 2.59988628e-02],\n",
" [-3.51230580e-02],\n",
" [ 3.49199739e-02],\n",
" [ 9.23856588e-03],\n",
" [-3.61601956e-02],\n",
" [-3.54745549e-02],\n",
" [-1.45804226e-02],\n",
" [ 6.86002538e-03],\n",
" [-5.78802060e-03],\n",
" [ 3.71721553e-02],\n",
" [ 2.31033116e-02],\n",
" [ 3.10893933e-03],\n",
" [ 8.70518250e-03],\n",
" [-4.57266641e-02],\n",
" [ 3.80878065e-02],\n",
" [ 6.18732228e-03],\n",
" [ 4.79684281e-04],\n",
" [ 1.11520573e-02],\n",
" [-3.31185744e-02],\n",
" [ 4.68683556e-02],\n",
" [-1.49874689e-02],\n",
" [-3.44729346e-02],\n",
" [-2.48734670e-02],\n",
" [ 7.37530889e-03],\n",
" [ 1.33301345e-02],\n",
" [ 3.15129755e-02],\n",
" [-6.19440819e-04],\n",
" [ 5.33935928e-02],\n",
" [ 3.71109788e-04],\n",
" [ 1.24270359e-02],\n",
" [-3.27045616e-02],\n",
" [ 3.90640081e-02],\n",
" [-3.41287328e-02],\n",
" [-4.29333854e-02],\n",
" [-2.29024878e-02],\n",
" [-1.69262862e-02],\n",
" [ 2.53205794e-02],\n",
" [-3.42092723e-03],\n",
" [-1.68694684e-02],\n",
" [-1.96152958e-03],\n",
" [-5.16237730e-03],\n",
" [ 2.49792128e-02],\n",
" [-2.93539208e-02],\n",
" [-2.30017851e-02],\n",
" [ 1.75209120e-02],\n",
" [ 2.85102681e-02],\n",
" [-2.98054721e-02],\n",
" [ 4.21270798e-02],\n",
" [-3.79042508e-02],\n",
" [-1.79329150e-02],\n",
" [ 2.69714184e-02],\n",
" [-7.65829778e-03],\n",
" [ 5.34366595e-02],\n",
" [-2.50243872e-02],\n",
" [-8.93702184e-03],\n",
" [-2.60786570e-02],\n",
" [ 3.42484598e-03],\n",
" [ 1.79377490e-03],\n",
" [-1.33919723e-02],\n",
" [ 1.83020755e-02],\n",
" [ 1.98001944e-02],\n",
" [ 6.73833164e-02],\n",
" [-2.12604091e-02],\n",
" [-2.02177766e-03],\n",
" [ 1.73243791e-02],\n",
" [-3.38738521e-02],\n",
" [-3.10173733e-02],\n",
" [ 3.48396547e-02],\n",
" [-1.03668042e-02],\n",
" [-2.82860271e-02],\n",
" [-3.14018262e-02],\n",
" [ 5.95991982e-02],\n",
" [-7.27377274e-03],\n",
" [ 2.51962673e-03],\n",
" [ 2.45368246e-02],\n",
" [-4.38233197e-02],\n",
" [ 1.73756713e-02],\n",
" [ 1.26303213e-03],\n",
" [-1.59406834e-02],\n",
" [-1.43064149e-02],\n",
" [-6.30846382e-03],\n",
" [-8.91552224e-03],\n",
" [-6.53103599e-03],\n",
" [ 2.13170079e-02],\n",
" [-1.64386725e-02],\n",
" [ 4.88061713e-02],\n",
" [-2.26740219e-02],\n",
" [ 1.93679955e-03],\n",
" [ 4.48509352e-02],\n",
" [ 6.95172314e-02],\n",
" [-1.15439364e-02],\n",
" [ 2.57775474e-02],\n",
" [ 3.37792243e-03],\n",
" [-4.88007772e-02],\n",
" [ 2.41316694e-03],\n",
" [ 1.82478569e-02],\n",
" [-6.53753435e-03],\n",
" [ 3.55267452e-02],\n",
" [-6.64407968e-04],\n",
" [ 2.61443646e-02],\n",
" [-2.24171015e-02],\n",
" [-3.10643198e-02],\n",
" [-4.67564623e-04],\n",
" [ 2.70659133e-02],\n",
" [ 3.42294895e-02],\n",
" [ 1.24537601e-02],\n",
" [ 4.59116402e-03],\n",
" [-9.06253495e-03],\n",
" [ 3.06714676e-02],\n",
" [-5.27384384e-03],\n",
" [-4.72307417e-02],\n",
" [-4.81553034e-02],\n",
" [ 1.72003328e-02],\n",
" [-5.78547317e-02],\n",
" [-1.10847101e-02],\n",
" [ 2.79296032e-02],\n",
" [-3.78801502e-02],\n",
" [ 4.14781452e-02],\n",
" [ 3.34212512e-02],\n",
" [ 3.78235072e-04],\n",
" [-3.21171769e-02],\n",
" [ 3.34742705e-02],\n",
" [-1.77152444e-02],\n",
" [-2.87723570e-02],\n",
" [ 3.08189708e-02],\n",
" [-3.18428519e-02],\n",
" [-4.15655531e-02],\n",
" [ 1.36175995e-04],\n",
" [-2.67928248e-02],\n",
" [ 1.03131059e-02],\n",
" [ 9.49765312e-03],\n",
" [-3.85137668e-03],\n",
" [-1.44831503e-02],\n",
" [ 1.67389811e-04],\n",
" [-8.91762199e-03],\n",
" [ 2.05854573e-02],\n",
" [ 3.34967999e-03],\n",
" [ 2.75580078e-03],\n",
" [-1.24999768e-02],\n",
" [ 1.92162764e-02]]), array([[-0.04063365],\n",
" [ 0.01500192],\n",
" [ 0.01155429],\n",
" [ 0.01084445],\n",
" [-0.02025007],\n",
" [ 0.00970291],\n",
" [-0.01869824],\n",
" [ 0.03025998],\n",
" [ 0.04717784],\n",
" [ 0.02069029],\n",
" [-0.00322925],\n",
" [-0.03524307],\n",
" [ 0.0583552 ],\n",
" [ 0.04365331],\n",
" [ 0.05732471],\n",
" [-0.01572487],\n",
" [ 0.02608565],\n",
" [-0.02453298],\n",
" [ 0.06522083],\n",
" [ 0.02926387],\n",
" [-0.02268049],\n",
" [-0.04218387],\n",
" [ 0.00430445],\n",
" [-0.00291497],\n",
" [ 0.02114237],\n",
" [ 0.00359234],\n",
" [ 0.01238629],\n",
" [-0.05348402],\n",
" [ 0.005845 ],\n",
" [ 0.06022076]]), array([[-0.17365484],\n",
" [-0.09489937],\n",
" [-0.12895467],\n",
" [-0.1621321 ],\n",
" [-0.1672037 ],\n",
" [-0.18413244],\n",
" [-0.18523752],\n",
" [-0.18385742],\n",
" [ 0.15470179],\n",
" [-0.16888425],\n",
" [-0.09014148],\n",
" [ 0.11352326],\n",
" [ 0.1927987 ],\n",
" [-0.16811378],\n",
" [-0.18508637],\n",
" [ 0.18735534],\n",
" [ 0.18322863],\n",
" [ 0.17512173],\n",
" [ 0.0838658 ],\n",
" [-0.17509903],\n",
" [-0.14821157],\n",
" [ 0.14748116],\n",
" [ 0.02902309],\n",
" [ 0.1668159 ],\n",
" [ 0.13671752],\n",
" [-0.09753125],\n",
" [-0.17599583],\n",
" [-0.16613489],\n",
" [-0.18254197],\n",
" [-0.17835342],\n",
" [-0.17021598]])]\n"
]
}
],
"source": [
"print(mlp.get_weights())\n",
"print(mlp.get_bias())"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"True\n",
"True\n"
]
}
],
"source": [
"# LOAD FEATURES\n",
"\n",
"# load params from file\n",
"fw = \"weights_0-815_2018-01-20_21:58:11.params\"\n",
"fb = \"bias_0-815_2018-01-20_21:58:11.params\"\n",
"res = mlp.load_weights(fw)\n",
"print(res)\n",
"res = mlp.load_bias(fb)\n",
"print(res)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"recognized: 'P'\n",
"expected: 'P'\n",
"recognized: 'r'\n",
"expected: 'r'\n",
"recognized: 'l'\n",
"expected: 'l'\n",
"recognized: 'd'\n",
"expected: 'd'\n"
]
}
],
"source": [
"# GENERALIZATION\n",
"\n",
"def recognize_letter(num_letter):\n",
" # Compute outputs\n",
" e = batch[0][1][num_letter]\n",
" res = output_to_hard(mlp.compute_outputs())\n",
" print(\"recognized: '{}'\".format(letters_data.get_letter_of_vector(res[:,num_letter].flatten().tolist())))\n",
" print(\"expected: '{}'\".format(letters_data.get_letter_of_vector(Y.T[:,num_letter].flatten().tolist())))\n",
"\n",
"recognize_letter(0)\n",
"recognize_letter(1)\n",
"recognize_letter(12)\n",
"recognize_letter(25)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"num_letter = 15\n",
"e = batch[0][1][num_letter]\n",
"#X = np.array(batch[0][0][0]).reshape(1, len(batch[0][0][0]))\n",
"\n",
"print(\"expected: '{}'\".format(letters_data.get_letter_of_vector(e)))\n",
"#mlp.set_all_input_examples(X.T)\n",
"#mlp.set_all_input_examples(X.T, m=X.shape[0])\n",
"mlp.set_all_training_examples(X.T,Y.T,m=X.shape[0])\n",
"print(mlp.compute_outputs())\n",
"res = output_to_hard(mlp.compute_outputs())\n",
"print(res)\n",
"print(res[:,num_letter].flatten().tolist())\n",
"# check the first input image\n",
"print(\"recognized: '{}'\".format(letters_data.get_letter_of_vector(res[:,num_letter].flatten().tolist())))\n",
"print(\"expected: '{}'\".format(letters_data.get_letter_of_vector(Y.T[:,num_letter].flatten().tolist())))\n",
"print(res[:,num_letter])\n",
"print(Y.T[:,num_letter])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'size': 300, 'dims': (12, 25), 'version': 'P5', 'max_value': 255}\n"
]
},
{
"ename": "NameError",
"evalue": "name 'mlp' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-3-12faa5e62470>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0mname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"data/ext_ln0_car0.pgm\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 16\u001b[0;31m \u001b[0mvec\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_recognized_char\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 17\u001b[0m \u001b[0mletter\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mletters_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_letter_of_vector\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvec\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"image \\\"{}\\\" recognized as '{}'\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mletter\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m<ipython-input-3-12faa5e62470>\u001b[0m in \u001b[0;36mget_recognized_char\u001b[0;34m(filename)\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_info\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0midata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mimg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_data_bin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmlp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcompute_outputs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0midata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 12\u001b[0m \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0moutput_to_hard\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mh\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mflatten\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtolist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'mlp' is not defined"
]
}
],
"source": [
"# RECOGNIZE IMAGE\n",
"from pnmimage import PnmImage\n",
"\n",
"def get_recognized_char(filename):\n",
" img = PnmImage()\n",
" if img.load(filename) == False:\n",
" print(\"ERROR: failed to open '{}'\".format(filename))\n",
" image_size = img.get_size()\n",
" print(img.get_info())\n",
" idata = img.get_data_bin()\n",
" output = mlp.compute_outputs(idata, 1)\n",
" h = output_to_hard(output)\n",
" return h.flatten().tolist()\n",
"\n",
"name = \"data/ext_ln0_car0.pgm\"\n",
"vec = get_recognized_char(name)\n",
"letter = letters_data.get_letter_of_vector(vec)\n",
"print(\"image \\\"{}\\\" recognized as '{}'\".format(name, letter))\n",
"\n",
"\n",
"name = \"data/ext_ln0_car10.pgm\"\n",
"vec = get_recognized_char(name)\n",
"letter = letters_data.get_letter_of_vector(vec)\n",
"print(\"image \\\"{}\\\" recognized as '{}'\".format(name, letter))\n",
"\n",
"name = \"data/ext_ln0_car15.pgm\"\n",
"vec = get_recognized_char(name)\n",
"letter = letters_data.get_letter_of_vector(vec)\n",
"print(\"image \\\"{}\\\" recognized as '{}'\".format(name, letter))\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"from pnmimage import PnmImage\n",
"filename = \"data/ext_ln0_car0.pgm\"\n",
"img = PnmImage()\n",
"if img.load(filename) == False:\n",
" print(\"ERROR: failed to open '{}'\".format(filename))\n",
"img2 = PnmImage()\n",
"w,h = img.get_dims()\n",
"img2.set_image(img.get_data(), w, h, 255, \"P5\")\n",
"img2.resize(12, 25)\n",
"img2.save(\"extl0c0.pgm\")"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAF91JREFUeJzt3X1wHPd93/H3B4dngARIAqYoPpiUQtthHCtSUEWK60bxUyg1I00naSpO3KiJbE5notZJPE3kSUdOlX/qNnUazyi2GVdV4kmlSq4nZV0mii3LcRpHiqBxIouUSMGibIISSZAUSYlPePr2j12QR+gOdwQPWOze5zVzc7e7v7v9LpfzucVv936riMDMzIqlJesCzMys8RzuZmYF5HA3Mysgh7uZWQE53M3MCsjhbmZWQA53M7MCcribmRWQw93MrIBas1rxwMBAbNy4MavVm5nl0rPPPns0IgZrtcss3Ddu3Mjw8HBWqzczyyVJ36+nnbtlzMwKyOFuZlZADnczswJyuJuZFZDD3cysgBzuZmYF5HA3Myug3IX73kNv8Jm/3MvRN89nXYqZ2ZKVu3B/6cgbfPYbIxw/PZ51KWZmS1buwl0IAN/X28ysuvyFe5LtBE53M7NqchfuLTPh7mw3M6sqd+FO2i0z7XQ3M6sqd+EuH7mbmdWUv3DPugAzsxzIX7jLV8uYmdVSM9wlPSjpiKTnqyz/RUnPSfqupG9Luq7xZZatL3321TJmZtXVc+T+ELB1juX7gZ+KiB8FfhfY0YC6qnKfu5lZbTVvsxcR35K0cY7l3y6bfApYd+VlVXfxOnczM6um0X3udwN/Xm2hpO2ShiUNj42NzWsFF/vcHe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v8WGIqId5P8yv1OirmfHwK2zpp3WftV0krgU8BPkAy3/qmZL4TLltxqLR8P4Gbg8bLpTwKfzLquBdrW/w18CNgLrEnnrQH2pq+/AGwra3+hXV4eJIPQPQG8H/gqye0ojwKts/c3yfAXN6evW9N2ynob5rHNfcD+2bUXdT9zcTjwlel++yrwM0Xdz8BG4Pn57ldgG/CFsvmXtLucR66O3KlvbPncS/8UvR54GlgdEa+liw4Bq9PXRfi3+K/AbwLT6fQq4EQk9wSAS7epKPcM2ASMAf897Y76oqQeCrqfI+Ig8HvAD4DXSPbbsxR/P8+43P3asP2dt3AvPEm9wP8Cfi0iTpUvi+SrvBCXN0n6WeBIRDybdS2LrBW4AfhcRFwPnObin+pA4fbzCpI7tW0CrgZ6eGvXRVNY7P2at3CvZ2z53JLURhLsfxoRX0lnH5a0Jl2+BjiSzs/7v8V7gdslvUJy68b3k/RF96f3BIBLt6muewbkwCgwGhFPp9NfJgn7ou7nDwL7I2IsIiaAr5Ds+6Lv5xmXu18btr/zFu71jC2fS5JEMnTyCxHxmbJF5WPl30XSFz8z/5fSs+43ASfL/vxb8iLikxGxLiI2kuzHb0TELwJPktwTAN66vbm/Z0BEHAIOSHpnOusDwB4Kup9JumNuktSd/h+f2d5C7+cyl7tfHwc+LGlF+lfPh9N5ly/rExDzOGFxG7AP+B7w21nX08Dt+sckf7I9B/x9+riNpL/xCeAl4OvAyrS9SK4c+h7wXZKrETLfjnlu+y3AV9PX1wB/B4wAjwEd6fzOdHokXX5N1nVfwfb+GDCc7us/A1YUeT8D/wF4EXge+BLQUcT9DDxMcl5hguQvtLvns1+BX0m3fwT45fnW41+ompkVUN66ZczMrA4OdzOzAnK4m5kVkMPdzKyAHO5mZgXkcDczKyCHu5lZATnczcwK6P8D+XnnFxrLAEoAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168d17748>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031307411466539793}\n",
"[[ 0.01201341 0.98092967 0.98092663 0.02404195]\n",
" [ 0.98798659 0.01907033 0.01907337 0.97595805]]\n",
"[array([[-2.40378742, 2.05154928],\n",
" [ 1.09713928, 1.09693386],\n",
" [ 2.05046244, -2.40358981]]), array([[ 2.57638752, 0.99113136, 2.57718917],\n",
" [-2.60126558, -0.77456271, -2.6004823 ]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAF3JJREFUeJzt3X+QXeV93/H35979vRIrgVZGSHIkG9FEprjgNYFxfxCbJILJoExLM2jixk1x9E9IncTTBk860JL+4zpDWs8Qx2pC3XgaKHE8qeoqJS6mztQuWMs4xYAisUYYxC8tSAj93h/32z/u2d27u/fuubu60t3n7Oc1o7n3POe55zxnj+azzz7nnOcqIjAzs2IptbsBZmbWeg53M7MCcribmRWQw93MrIAc7mZmBeRwNzMrIIe7mVkBOdzNzArI4W5mVkAd7drxunXrYsuWLe3avZlZkp555pm3I2Iwr17bwn3Lli0MDw+3a/dmZkmS9KNm6nlYxsysgBzuZmYF5HA3Myug3HCX9LCko5Kea7D+FyU9K+kHkr4r6cOtb6aZmS1GMz33rwA7Flh/GPgHEfG3gd8B9rSgXWZmdgFy75aJiL+StGWB9d+tWXwK2HThzTIzswvR6jH3u4G/aPE2zcxskVoW7pJ+imq4/9YCdXZLGpY0PDo6uqT9HHzzJA/+5UHePnV+iS01Myu+loS7pOuAPwR2RsQ7jepFxJ6IGIqIocHB3Aes6nrx6Em++K0Rjp0eW2JrzcyK74LDXdL7ga8D/yQiDl14k3L2hwDw93qbmTWWe0FV0iPALcA6SUeA+4FOgIj4A+A+4Arg9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8m2gY+75pvqE9M3Z+46sntp9DEs45gHg8Ny2F/U8MzNj7OXZefsG8LNFPc/AFuC5pZ5XYBfw5ZryWfUW8y+pnjvNTT+cvOxP0euBp4H3RcQb2ao3gfdl74vws/j3wL8EKtnyFcC7UZ02GmYfU1PTSidgKzAK/KdsOOoPJfVT0PMcEa8Bvwu8ArxB9bw9Q/HP85TFnteWne/Uwr3wJK0C/gz49Yh4r3ZdVH+VF+L2Jkk/BxyNiGfa3ZZLrAO4AfhSRFwPnGbmT3WgcOd5LdUv89kKXAX0M3/oYkW41Oc1tXBvZvrhZEnqpBrs/yUivp4VvyVpQ7Z+A3A0K0/9Z/Ex4A5JL1P9dq+PUx2LXpNNGw2zj6ko00ofAY5ExNPZ8teohn1Rz/OtwOGIGI2IceDrVM990c/zlMWe15ad79TCvZnph5MkSVRn1zwQEQ/WrKqdTvlTVMfip8p/KbvqfhNwoubPv2UvIj4XEZsiYgvV8/itiPhF4Emq00bD/ONNflrpiHgTeFXS38qKPgG8QEHPM9XhmJsk9WX/x6eOt9DnucZiz+vjwM9IWpv91fMzWdnitfsCxBIuWNwOHAJ+CPx2u9vTwuP6u1T/ZHsW+Ovs3+1UxxufAF4E/hdweVZfVO8c+iHwA6p3I7T9OJZ47LcA38jefwD4HjAC/CnQnZX3ZMsj2foPtLvdF3C8fwcYzs71nwNri3yegX8D/A3wHPBVoLuI5xl4hOp1hXGqf6HdvZTzCvyz7PhHgF9eanv8hKqZWQGlNixjZmZNcLibmRWQw93MrIAc7mZmBeRwNzMrIIe7mVkBOdzNzArI4W5mVkD/HxWQpdjMgRU0AAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168c3dcc0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031190216120355926}\n",
"[[ 0.01277621 0.9811383 0.98114161 0.02333379]\n",
" [ 0.98722379 0.0188617 0.01885839 0.97666621]]\n",
"[array([[-1.01205709, -1.01200878],\n",
" [ 2.08751553, -2.38975991],\n",
" [-2.38947784, 2.08601873]]), array([[-0.78583897, 2.64231438, 2.5581069 ],\n",
" [ 0.77756604, -2.57364066, -2.65805014]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHSVJREFUeJzt3X10XHd95/H3Z0aSJevBD5H8ED/Eju0kmGAIEQ7Py0kIcYC1t8vDsVt2gU3j7lkCaSl0k1M2ZcOe00PbhS27WZosZaEpxE1TDniDqaEBWggJWA6OiZM4UZwHy4ltOX5+1NN3/5greyxLnrE88swdfV7n6Oje3/3pzvfq6nzm6nfv3KuIwMzMqkum3AWYmVnpOdzNzKqQw93MrAo53M3MqpDD3cysCjnczcyqkMPdzKwKOdzNzKqQw93MrArVlOuFW1tbY968eeV6eTOzVNq4ceOeiGgr1K9s4T5v3jw6OjrK9fJmZqkk6cVi+nlYxsysCjnczcyqkMPdzKwKOdzNzKqQw93MrAo53M3MqpDD3cysCqUu3De8sJcv/XArvf0D5S7FzKxipS7cH3txH1/5cafD3czsLFIX7hkJgAE/19vMbESpC/ck2xkIp7uZ2UhSF+6DR+7hURkzsxGlMNxz333kbmY2svSFe5Lu/Q53M7MRpS/cT55QdbibmY2kqHCXtEzSVkmdkm4bZvlcST+R9GtJmyW9t/Sl5pwcc3e2m5mNqGC4S8oCdwE3AouBVZIWD+n2OeD+iLgKWAn871IXOshj7mZmhRVz5L4U6IyIbRHRA6wBVgzpE0BLMj0JeLl0JZ7O17mbmRVWTLjPArbnzXclbfk+D3xEUhewDvjkcCuStFpSh6SO7u7uUZSbd527093MbESlOqG6CvhGRMwG3gvcK+mMdUfEPRHRHh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7yTNuyTNTJbPBHYn7Wn/XbwNWC7pBXLPCLiW3Hj05OTmc3D6NhV1c7oK1wV0RcQvk/kHyIV9te5jgHcDz0dEd0T0At8ht++reT/nO9d9W7J9nrZwP3kTs+Ts+kpyNy1LPUkid4+epyLiS3mLBm/KRvL9e3nt/z456/5m4EDev38VLyJuj4jZETGP3H78cUT8DvATcjefgzO3d/D3UNTN6SpNROwEtku6PGm6DniSKt3HiZeAN0uamPyND25z1e7nIc51364H3iNpSvJfz3uStnNX7hMQozhh8V7gGeA54I/LXU8Jt+vt5P5l2wxsSr7eS2688SHgWeCfgKlJf5G7cug54DfkrkYo+3aMctvfBTyYTF8K/AroBP4emJC01yfzncnyS8td9yi39Q1AR7KfvwtMqfZ9DPxX4GngCeBeYEI17mfgPnLnFXrJ/Zd202j2LfAfku3vBD4+2nr8CVUzsyqUtmEZMzMrgsPdzKwKOdzNzKqQw93MrAo53M3MqpDD3cysCjnczcyqkMPdzKwK/X9FSS3u38GL5wAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168c96da0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.03171314920552748}\n",
"[[ 0.01947007 0.97421129 0.98964546 0.01990589]\n",
" [ 0.98052993 0.02578871 0.01035454 0.98009411]]\n",
"[array([[ 1.31420216, -1.30600905],\n",
" [-1.99140538, -2.44175863],\n",
" [-2.37396126, -1.90332763]]), array([[ 1.09790652, -2.56363219, 2.62272519],\n",
" [-1.17325226, 2.53073242, -2.49247235]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmw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8CzJPMTwaXbO/Z7qGn+omtNRBwGDkh6b9p0F7CbjO7j1JvAnZI60v/jY9uc2f08yZXu2x3AT0pakP7V85Np25Vr9AmIaZyw+BTwCvAa8MuNrqeO2/Uxkj/ZXgReSB+fIjne+DTwKvAXwMK0v0iuHHoNeInkaoSGb8c0t/0TwLfS5ZuAHwD9wDeBOWl7W7renz5/U6Prnua23g70pfv5T4EFWd/HwK8BLwM/Av4QmJPF/Qx8g+S8whDJX2mfnc6+Bf5puv39wGemW4/vUDUzy6BmOyxjZmY1cLibmWWQw93MLIMc7mZmGeRwNzPLIIe7mVkGOdzNzDLI4W5mlkH/H/CefS2QFsrUAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168ab11d0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031608250656706208}\n",
"[[ 0.01040672 0.98043232 0.98045294 0.02558199]\n",
" [ 0.98959328 0.01956768 0.01954706 0.97441801]]\n",
"[array([[ 1.95863856, -2.4323066 ],\n",
" [ 1.29725725, 1.29857176],\n",
" [ 2.43125627, -1.95172388]]), array([[ 2.60363554, 1.11416206, -2.65643781],\n",
" [-2.49021505, -1.09446745, 2.43728256]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAGUZJREFUeJzt3X1sXfd93/H35z7wQRL1zMiKJFuyIydRnKRxOMVBii1I7ExONqlokkHGijlbNmFAtHp1sU1GBndzMGBuh6TroGURmnRF0ERxvaJjPa1C6yTN0s2p6MZVLCmKGdmxqNgWbT1b4sMlv/vjnktdXl6Kl9Ilr87h5wXQv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Cci7qJ8UcZOsnmc/zuwraZtVsdW0krgN4APUH46wG9U/iDMWvnjx9LxBXwQOFi1/AjwSKvrmqN9/Z/AfcBxYG3SthY4nrz+CvBAVf+Jfmn5onzPxNPAR4CnKH/s5OtAofZ4U75a64PJ60LST63eh1nu7zLgxdq6M36MK3evr0yO21PA383qcQY2As9f77EFHgC+UtU+qd9svlI1cqexRyGkXvJP0fcBPwDWRMQryVuvAmuS11n4Xfw28K+B8WR5FXAuyo+wgMn71NAjLm5ym4BB4PeSqajflbSYDB/jiDgF/CfgZeAVysftWbJ9nKvN9tg27ZinLdwzT9IS4H8A/zIiLlS/F+U/5Zm4vEnS3wNOR8Szra5lHhWAu4EvR8T7gDe5+s90IFvHGCCZUthB+Q/bW4HFTJ26WBDm+9imLdwbeRRCakkqUg72P4iIP0qaX5O0Nnl/LXA6aU/77+JDwHZJL1F+0uhHKM9HL08eYQGT92lifxt9xMVNaAAYiIgfJMtPUg77rB5jgHuBFyNiMCJGgT+ifOyzfJyrzfbYNu2Ypy3cG3kUQipJEuU7fY9FxBer3qp+tMODlOfiK+3/KDnrfg9wvuqffze9iHgkItZHxEbKx/HbEfEPge9QfoQFTN3fVD/iIiJeBU5KenvS9FHgKBk9xomXgXskLUr+H6/sc2aPc43ZHtuDwMckrUj+1fOxpG32Wn0C4jpOWHwc+AnwU+Dzra6nifv1i5T/yXYYeC75+jjl+cangReAPwdWJv1F+cqhnwI/onw1Qsv34zr3/cPAU8nr24G/AvqBPwTak/aOZLk/ef/2Vtd9nfv6C0Bfcpz/GFiR9WMM/Hvgx8DzwNeB9iweZ+CblM8rjFL+V9pnr+fYAv8k2f9+4B9fbz2+Q9XMLIPSNi1jZmYNcLibmWWQw93MLIMc7mZmGeRwNzPLIIe7mVkGOdzNzDLI4W5mlkH/HxH4B4KyxQvlAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168d9b860>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031173368398727086}\n",
"[[ 0.01325791 0.98116572 0.98116461 0.02288485]\n",
" [ 0.98674209 0.01883428 0.01883539 0.97711515]]\n",
"[array([[ 0.94818634, 0.94787128],\n",
" [-2.11042432, 2.38249017],\n",
" [ 2.38249803, -2.1105769 ]]), array([[ 0.68033473, -2.55026254, -2.63855001],\n",
" [-0.79177884, 2.68207786, 2.59393157]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAFr5JREFUeJzt3XuMXOd53/HvMzN74WV5E5e6kRIVmLKr+CZ3q/rSNIYviWy0Ioq6jtQGVVvD+qdKncZoKyOB0spIAaeFkxhQAyttmsRorSpuLoTCRGkkuS5a2xVpp7JEmhYtWyapCymJIilRS+7uPP1jzpKzwx3OcLXc4Tn7/QCLnXPOO3Oew0P85t13znknMhNJUrXUBl2AJGnxGe6SVEGGuyRVkOEuSRVkuEtSBRnuklRBhrskVZDhLkkVZLhLUgU1BrXjjRs35tatWwe1e0kqpd27d7+YmeO92g0s3Ldu3cquXbsGtXtJKqWIeKafdg7LSFIFGe6SVEGGuyRVkOEuSRVkuEtSBRnuklRBhrskVVDpwv2xH77M5/98H1MzzUGXIkmXrNKF+7eeOcoXHtlvuEvSeZQu3GsRADT9Xm9J6qp04V5kO8003SWpm9KF+5meu113SeqqdOFerzksI0m9lC7caw7LSFJPpQv3OPOBquEuSd2ULtzPjrkPuBBJuoSVMNxbv+25S1J35Qv3msMyktRL+cK9GJYx2yWpu77CPSJujoh9EbE/Iu6aZ/s1EfFoRHw7Ih6PiI8ufqktDstIUm89wz0i6sC9wEeAG4DbIuKGjma/BDyQmT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V75UXEauC/Az+fmcfbt2XrrbwSlzdFxN8CDmfm7kHXsoQawLuA38zMG4HXOPtnOlCtcwxQDClsp/XGdhWwinOHLpaFpT63ZQv3fiYxK62IGKIV7P8lM/+gWP1CRFxZbL8SOFysL/u/xfuAWyLih7S+I+ADtMaj1xWTz8HcY6rC5HQHgYOZ+c1i+Su0wr6q5xjgQ8APMvNIZk4Bf0Dr3Ff5PLe70HO7aOe8bOF+ZhKz4tP1W2lNWlZ6ERG05ujZm5mfb9s0Oykbxe8/blv/D4tP3d8NHGv78++Sl5mfyczNmbmV1nl8JDP/AfAorcnn4Nzjnf136GtyuktNZj4PHIiINxerPgjsoaLnuPAj4N0RsbL4Pz57zJU9zx0u9Nw+BPxURKwv/ur5qWLdhRv0BxAL+MDio8D3gO8DvzjoehbxuP4GrT/ZHgf+svj5KK3xxoeBp4C/ADYU7YPWlUPfB75D62qEgR/HAo/9/cCDxeMfA/4vsB/4fWCkWD9aLO8vtv/YoOte4LG+E9hVnOc/AtZX/RwD/wb4LvAE8CVgpIrnGfgyrc8Vpmj9lfaJhZxb4J8Ux78f+McLrcc7VCWpgso2LCNJ6oPhLkkVZLhLUgUZ7pJUQYa7JFWQ4S5JFWS4S1IFGe6SVEH/HwNjDjwFLJO+AAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168d9bdd8>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.03154258548825048}\n",
"[[ 0.01070599 0.98053425 0.98054138 0.02528557]\n",
" [ 0.98929401 0.01946575 0.01945862 0.97471443]]\n",
"[array([[ 2.42644979, -1.97438771],\n",
" [-1.97687282, 2.42683032],\n",
" [ 1.25642219, 1.25681975]]), array([[-2.50547448, -2.4802892 , 1.03686812],\n",
" [ 2.60455426, 2.62973858, -1.08774409]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CA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Y95q4V7PpRBakiRROdP3hYj4euqp9KUd7qMyFz/R/g+TT93vAM6m/vy76kXEgxGxOiLWUjmOT0TE3wOepHIJC7h8f1v6EhcRcQw4LOm9SdMngQNk9Bgn3gDukNSV/B+f2OfMHucqsz22e4BPSbo2+avnU0nb7DX7A4g5fGDxS8BLwCvAbza7ngbu11+j8ifbc8Czyc8vUZlvfBx4GfjfwLKkv6h8c+gV4MdUvo3Q9P2Y475/Avh+8vhdwJ8D/cAfAaWkvTNZ7k+ef1ez657jvv4c0Jcc5z8Brs36MQb+NfAi8DzwHaCUxeMMfI/K5wojVP5K+8Jcji3wj5P97wf+0Vzr8RmqZmYZ1GrTMmZmVgeHu5lZBjnczcwyyOFuZpZBDnczswxyuJuZZZDD3cwsgxzuZmYZ9P8B/S1MRNFaFF0AAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168b591d0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031525533033675182}\n",
"[[ 0.01074898 0.98057629 0.98056179 0.02524762]\n",
" [ 0.98925102 0.01942371 0.01943821 0.97475238]]\n",
"[array([[ 1.97510636, -2.42520404],\n",
" [-1.25432208, -1.25347711],\n",
" [-2.42596987, 1.98011715]]), array([[ 2.6373461 , -1.08073471, 2.5626286 ],\n",
" [-2.47595591, 1.02462783, -2.55069231]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAFvhJREFUeJzt3WtwXOd93/HvfwEsCIAXgCQoS6QkUjblWHbr0KFluW5a11YcWVNLmUmnI047dVo3epG6dhpPOvK4Y7vudDpu2tx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Nz4EPAv8L2B10T9o3Dn0HPDnNO5G6PhxnOexfxB4oHh8HfD/gD3AHwD9RfuyYntP8fx1na77PI/1x4FdxXn+I2Ck6ucY+KfA08BuGqvH9lfxPAPfoHFdYYLGX2mfOJ9zC/y94vj3AH/3fOvxHaqSVEFlm5aRJLXBcJekCjLcJamCDHdJqiDDXZIqyHCXpAoy3CWpggx3Saqg/w+JehxCM7DPXgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168b595c0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031683047301714236}\n",
"[[ 0.01018743 0.98029666 0.98032557 0.02578303]\n",
" [ 0.98981257 0.01970334 0.01967443 0.97421697]]\n",
"[array([[-2.43573983, 1.93739017],\n",
" [ 1.94743329, -2.43717401],\n",
" [ 1.31728188, 1.31872773]]), array([[ 2.62528113, 2.58070129, 1.19489233],\n",
" [-2.45354582, -2.49815408, -1.102795 ]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAGz5JREFUeJzt3X+QHOV95/H3d2Z2V1qttPqxK6GfrGQLC/HDQNYYzrEPY2wLgqW6yyUnVXx2EmxVUiHnXHy+4LIL7sgfdySpxE6KYCs+jovvDgLYZas42VzA+Ahng1kZDAIhe5EASQa0+ol+787M9/7ontnZ1UxPa3dWo+75vKq2dvrpZ7ufVqs+++zTT3ebuyMiIumSaXYDRESk8RTuIiIppHAXEUkhhbuISAop3EVEUkjhLiKSQgp3EZEUUriLiKSQwl1EJIVyzdpxT0+P9/X1NWv3IiKJtHXr1v3u3luvXt1wN7N7g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+c9d/+iuy9x9z6C8/gDd/8t4AmCdwLAmceb+HcGuPtbwG4ze09Y9BHgZVJ6ngmGY64xs87w/3jpeFN9niuc7Xl9FPiYmc0J/+r5WFh29pp9AWICFyxuAn4OvAp8qdntaeBx/SrBn2wvAM+HXzcRjDc+DvwCeAyYG9Y3gplDrwIvEsxGaPpxTPDYrwMeCT+vAH4CDAIPAR1h+bRweTBcv6LZ7Z7E8V4BDITn+jvAnDSfZ+A/Aa8A24BvAh1pPM/A/QTXFUYI/kK7ZSLnFfjd8PgHgd+ZaHt0h6qISAolbVhGRERiULiLiKSQwl1EJIUU7iIiKaRwFxFJIYW7iEgKKdxFRFJI4S4ikkL/H1M1DeNepIEaAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168e1c710>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.029568589776941649}\n",
"[[ 0.01511589 0.98320551 0.98320552 0.01904326]\n",
" [ 0.98488411 0.01679449 0.01679448 0.98095674]]\n",
"[array([[-1.68718666, -1.68717444],\n",
" [ 1.83309543, 1.83310216],\n",
" [ 2.30099652, 2.30099339]]), array([[-1.62268664, 1.73477196, -2.79082854],\n",
" [ 1.45111486, -1.79528538, 2.86262592]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAGpJJREFUeJzt3X+QXWd93/H35967d1e7+o0WWUiKJYOIraFgw+JAyLQETCrTVKIDaaWWBiiJJx1EaGDa2JOMk7r9B5JCW0bNWA2UDA0ojskQlQrU1LhNyICrle0Yy7LwIrC1wo7WsmRbkr27d/fbP+7Z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kHSmuRfPb+QlM1fpy9ALOCCxXuBHwA/BH6r0+1p43H9HNV/sj0CPJz8vJfqeON9wBPA/wbWJvVF9c6hHwLfp3o3QsePY4HH/k7gG8nn64D/BwwBfwp0J+U9yfJQsv66Trd7gcd6IzCYnOevA2vyfo6Bfws8DjwKfBnozuN5Br5K9brCONV/pX10IecW+BfJ8Q8BH1loe/yEqplZDmVtWMbMzFrgcDczyyGHu5lZDjnczcxyyOFuZpZDDnczsxxyuJuZ5ZDD3cwsh/4/blehvSjUmqsAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168d4edd8>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.029539589789047232}\n",
"[[ 0.01679547 0.98104616 0.98492497 0.01677683]\n",
" [ 0.98320453 0.01895384 0.01507503 0.98322317]]\n",
"[array([[-1.79884923, 1.79823306],\n",
" [ 1.70777996, -1.71099719],\n",
" [-2.30993664, 2.31112542]]), array([[-1.80202919, 1.54409123, 3.00612475],\n",
" [ 1.65069614, -1.6289642 , -2.64412463]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAFxVJREFUeJzt3X+Q3Hd93/Hne3dvpbuTfJKlM5ZtgQQoEAUnQBViYjrjAZLYnmLPNJliTzMhlMH/QEMbpq2ZdKClf3RIOqQl4xDclpIyAdchmVTjunUacKZTJnZ9xonjHxgOg23ZMjrLsmT7JN+vd//Y70mru9vbPWml1fd7z8fMze73+/3ou+/vfTWv/dzn+93PRmYiSaqW2qALkCT1n+EuSRVkuEtSBRnuklRBhrskVZDhLkkVZLhLU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P7zCEX3Pp939AAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168c15c50>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.030909668962820103}\n",
"[[ 0.0182439 0.98169159 0.98170459 0.01828506]\n",
" [ 0.9817561 0.01830841 0.01829541 0.98171494]]\n",
"[array([[-2.29039539, 2.29288139],\n",
" [-2.27465684, 2.27075963],\n",
" [-0.32154128, 0.36092221]]), array([[-2.72086854, 2.66959205, 0.15999313],\n",
" [ 2.69089272, -2.65182681, -0.25901182]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAF3BJREFUeJzt3VuQHOd53vH/MzM7u8AusMAeBOFEAnQgWZBCSfQKJiOnirFkm2RF5IVdMZG4JMsqMxdmQsVKUlScEh3mSnEiOapiZDG2IkeViKEYx0LJcOiEoiwlMSUuQ4ohQEJcghQBECAWZxCnPcybi+4FB4udncFidgfd/fyqpma655vpt9GoZ779pvsbRQRmZpYvpU4XYGZm7edwNzPLIYe7mVkOOdzNzHLI4W5mlkMOdzOzHHK4m5nlkMPdzCyHHO5mZjlU6dSGh4aGYtOmTZ3avJlZJj3zzDNHImK4WbuOhfumTZsYHR3t1ObNzDJJ0k9aaedhGTOzHHK4m5nlkMPdzCyHHO5mZjnkcDczyyGHu5lZDjnczcxyKHPh/vRrx/jCX+xhYqrW6VLMzK5ZmQv3//uT43zpO2NM1RzuZmaNZC7cSxIANf+ut5lZQ5kL9zTbqYXT3cyskcyF+0zPPTwqY2bWUAbDPbl3z93MrLHshXtpZszd4W5m1kjmwl3+QtXM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4P0k+57bYyxpPfAPgZGIeB/JhZB3k8/j/DXgtlnrrujYShoAHgB+lmRG3gdmPhCuWKQ/tZaFG3AL8Hjd8meBz3a6rkXa128BvwDsAdam69YCe9LHXwG217W/2C4rN5J5ip4Afh74NslPWR4BKrOPN8kV0rekjytpO3V6H65wf/uBV2fXnfNjPDNj7EB63L4N/FJejzOwCXhhoccW2A58pW79Je2u5JapnjutTT+ceemfoh8EfgCsiYiD6VOHgDXp4zz8W/w+8E+BWro8CJyIZNpouHSf8jCt9GZgHPgP6VDUH0rqJcfHOCIOAP8aeB04SHLcniHfx7nelR7bth3zrIV77knqA/4r8OmIOFX/XCQf5bk4vUnS3wYOR8Qzna5lCVWAm4AvR8QHgTO8/Wc6kK9jDJAOKdxF8sG2Dujl8qGLQljqY5u1cG9l+uHMktRFEuz/KSL+JF39pqS16fNrgcPp+qz/W3wYuFPSayS/7vXzJOPRq9Jpo+HSfWppWulr3H5gf0T8IF1+jCTs83qMAT4KvBoR4xExCfwJybHP83Gud6XHtm3HPGvh3sr0w5kkSSSza74YEV+oe6p+OuVPkIzFz6z/ePqt+83Aybo//655EfHZiNgQEZtIjuN3IuLvAU+STBsNl+9vpqeVjohDwD5J705XfQTYTU6Pcep14GZJy9P/4zP7nNvjPMuVHtvHgV+UtDr9q+cX03VXrtNfQCzgC4s7gB8DrwC/0+l62rhfP0fyJ9vzwHPp7Q6S8cYngJeB/wkMpO1FcubQK8D/IzkboeP7scB9vxX4dvr4BuCHwBjwTaA7Xd+TLo+lz9/Q6boXuK8fAEbT4/ynwOq8H2PgXwAvAS8AXwe683icgW+QfK8wSfJX2qcWcmyB30j3fwz45ELr8RWqZmY5lLVhGTMza4HD3cwshxzuZmY55HA3M8shh7uZWQ453M3McsjhbmaWQw53M7Mc+v/6HvGy4uyBCgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168b15240>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.030990839306405914}\n",
"[[ 0.01813026 0.98143277 0.98141819 0.01828576]\n",
" [ 0.98186974 0.01856723 0.01858181 0.98171424]]\n",
"[array([[-2.29004145, 2.28505435],\n",
" [-2.28251732, 2.28899117],\n",
" [-0.12602234, -0.07785231]]), array([[ 2.6566979 , -2.65259994, -0.16570456],\n",
" [-2.7076025 , 2.70871881, 0.10802586]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAFfRJREFUeJzt3X1wZfV93/H3917prqTdZdkFsca7C0vK4ngnDwYrxB43tRtwCowL04dpYJopbZnwR+uWNp528CTjtHT6h5vWzsMQ17Rxk/GkJsTNJFtKjBuM0zqxKcIPhIeAxdrALsZo8bI87C5aSd/+cY+0V9K9uldCu1fn6P2aEbrnnJ/u/Z09zEc/fc85vxOZiSSpWmr97oAkae0Z7pJUQYa7JFWQ4S5JFWS4S1IFGe6SVEGGuyRVkOEuSRVkuEtSBQ3064PPP//83Lt3b78+XpJK6ZFHHjmSmaPd2vUt3Pfu3cv4+Hi/Pl6SSikinu2lnWUZSaogw12SKshwl6QKMtwlqYIMd0mqIMNdkirIcJekCipduD/83R/wiS8+xdT0bL+7IknrVunC/evPHuXXvzTB9KzhLkmdlC7caxEAzPpcb0nqqHThXmQ7s2m6S1InJQz3ZrqnVRlJ6qh04V4rRu6JI3dJ6qSE4W7NXZK6KV24W3OXpO5KGO5Fzd1sl6SOShfu8zV3012SOipduAfW3CWpm9KFe82auyR1VcJwL2rufe6HJK1npQv3+atlrMtIUkclDHevlpGkbkoX7t6hKkndlTDcvVpGkropXbh7h6okdVfCcJ+ruRvuktRJ6cL99B2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4BjLX/+rXuZ+dHM3J2Ze2kexy9l5t8HHqQ5sygs3d9SzzyamS8Cz0fEO4pVVwFPUNFjXHgOeE9EjBT/j8/tc2WP8yIrPbb3Az8TEduLv3p+pli3cv0+AbGKExbXAU8DzwC/2O/+rOF+/VWaf7I9Cnyz+LqOZr3xAeDbwJ8AO4r2QfPKoWeAv6B5NULf92OV+/4B4N7i9Q8B/w+YAH4f2FSsHyqWJ4rtP9Tvfq9yX98FjBfH+Q+B7VU/xsC/Bf4SeIzm7LGbqnicgc/RPK9wiuZfabes5tgC/7jY/wngH622P96hKkkVVLayjCSpB4a7JFWQ4S5JFWS4S1IFGe6SVEGGuyRVkOEuSRVkuEtSBf1/k3NxuhvCHCoAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168b9b710>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031172163993440746}\n",
"[[ 0.01323903 0.98116568 0.98116371 0.0228989 ]\n",
" [ 0.98676097 0.01883432 0.01883629 0.9771011 ]]\n",
"[array([[-2.10901333, 2.38250007],\n",
" [-0.95006233, -0.94990313],\n",
" [-2.38264612, 2.10972493]]), array([[-2.61208829, -0.73383215, 2.5480982 ],\n",
" [ 2.62017598, 0.74351283, -2.6841455 ]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAHkhJREFUeJzt3Xt0XGd57/HvMxdpZF1sSxo7vt9D8OGSEOE4CStwEqBOaOOuFdpjt0ACtF7twYVCe9rklJXStGu1UA6Xw3EBl1ubFkwIlBrwiRucwCkQEstJcOJbLF8Sy0lsSb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JaRvpXMfPS0YH0iuPSYLh5vvusXFaFmoNndnwz2HyYT9qV6jgHeDhxy9xZ37wa+R+bcl/J5zjbac1uwcx61cL+4zk3w7voaMuvaRJ6ZGZllHPa4+2ey7upft4fg33/Pan9f8K77SuB01p9/Rc/d73P3ue6+kMx5fMzdfxd4nMz6RHD58fb/HvJav6jYuPurwBEze03QdBuwmxI9x4GXgJVmNiX4b7z/mEv2PA8y2nO7FXinmU0P/up5Z9A2emG/ATGGNyzuAF4ADgB/EXY9BTyut5D5k20n8Gxwu4PMfOM2YD/wY6A26G9krhw6ADxH5mqE0I9jjMf+NuCHwfZi4CmgCfgOUB60p4L9puD+xWHXPcZjvRZoDM7z94HppX6Ogb8C9gLPAw8C5aV4noFvkXlfoZvMX2kfHMu5BT4QHH8T8P6x1qNPqIqIlKCoTcuIiEgeFO4iIiVI4S4iUoIU7iIiJUjhLiJSghTuIiIlSOEuIlKCFO4iIiXo/wPvVZVmaWASFQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168abd828>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.032040197611202727}\n",
"[[ 0.01980879 0.99050958 0.97326637 0.0205133 ]\n",
" [ 0.98019121 0.00949042 0.02673363 0.9794867 ]]\n",
"[array([[-2.46362625, -1.95001825],\n",
" [ 1.42435576, -1.41739194],\n",
" [ 1.80506112, 2.35899248]]), array([[-2.55030002, -1.29993761, -2.61261471],\n",
" [ 2.50032809, 1.30450224, 2.46367636]])]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAF2dJREFUe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yz23LTvnaQv3ZqYfTiVJojK75oGI+ErVpurplD9NZSx+fv2vJFfdbwFOV/35t+5FxBciYkdE7KRyHn8QEf8AeIzKtNFw+fGmelrpiHgTOCzpPcmqTwAvkNFznHgNuEVST/J/fP6YM3ueF1nuuX0E+JSkgeSvnk8l65av3RcgVnDB4nbgJ8BPgS+2u54WHtdfo/In2zPAj5PH7VTGGx8FXgL+FNictBeVO4d+CjxL5W6Eth/HCo/9Y8DDyfPrgL8ERoE/BDqT9V3J8miy/bp2173CY/0ZYCQ5z98DBrJ+joF/BbwIPAd8C+jM4nkGvk3lusI0lb/SPrOScwv8WnL8o8CvrrQev0PVzCyD0jYsY2ZmTXC4m5llkMPdzCyDHO5mZhnkcDczyyCHu5lZBjnczcwyyOFuZpZB/x/7ACCAlyXJCgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f5168cd7978>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'iterations': 1000, 'cost_function': 0.031513758450649069}\n",
"[[ 0.01084562 0.98057713 0.98059074 0.02515126]\n",
" [ 0.98915438 0.01942287 0.01940926 0.97484874]]\n",
"[array([[ 1.23841713, 1.2391942 ],\n",
" [-1.98703322, 2.42462157],\n",
" [ 2.42389936, -1.98229619]]), array([[ 0.94829548, -2.58994826, -2.57924959],\n",
" [-1.13555925, 2.52750395, 2.53819839]])]\n"
]
}
],
"source": [
"from mlp import MultiLayerPerceptron\n",
"import numpy as np\n",
"#mlp = MultiLayerPerceptron(L=1, n=[2, 1], g=[\"sigmoid\"], alpha=0.1)\n",
"\n",
"X = np.array([[0, 0],\n",
" [0, 1],\n",
" [1, 0],\n",
" [1, 1]])\n",
"\n",
"Y = np.array([[0, 1],\n",
" [1, 0],\n",
" [1, 0],\n",
" [0, 1]])\n",
"#Y = np.array([[0],\n",
"# [1],\n",
"# [1],\n",
"# [0]])\n",
"\n",
"for i in range(15):\n",
" mlp = MultiLayerPerceptron(L=2, n=[2, 3, 2], g=[\"tanh\", \"tanh\"], alpha=1, w_rand_factor=1)\n",
" mlp.use_regularization(lambd=0.01)\n",
" #mlp.use_rmsprop()\n",
" res = mlp.learning(X.T, Y.T, 4, max_iter=1000, plot=True)\n",
" print(res)\n",
" print(mlp.get_output())\n",
" print(mlp.get_weights())\n",
"#mlp.set_all_training_examples(X.T, Y.T, 4)\n",
"#mlp.prepare()\n",
"#print(mlp.propagate())\n",
"#for i in range(100):\n",
"# print(mlp.back_propagation())\n",
"# mlp.propagate()\n",
"#print(mlp.propagate())\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 0.06521739]\n",
" [ 0.02173913]\n",
" [ 0.89130435]\n",
" [ 0.02173913]]\n",
"1.0\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"a = np.ones((4,1))\n",
"a[0] = 3\n",
"a[2] = 41\n",
"res = np.zeros((4,1))\n",
"res = a / np.sum(a)\n",
"print(res)\n",
"print(np.sum(res))"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.0048747400000000007"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.sum(np.array([ 0.00015156, 0.00015268, 0.00015293, 0.00015146, 0.0001536, 0.0001529,\n",
" 0.0001529, 0.0001523, 0.00014965, 0.0001527, 0.00015024, 0.00015229,\n",
" 0.00015458 ,0.00015043 ,0.00015286, 0.00015533, 0.00015488, 0.00015392,\n",
" 0.00015377 , 0.0001549 , 0.0001537 , 0.00015145 , 0.00014796 , 0.00014766,\n",
" 0.00014974 , 0.00015326 ,0.00014838, 0.00015275 , 0.00015331, 0.00015493,\n",
" 0.0001541 , 0.00015162]))"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 1 -2 3 4]\n",
" [ 5 6 -7 8]]\n",
"[[1 0 3 4]\n",
" [5 6 0 8]]\n",
"[ 6 4 -4 12]\n",
"[ 6 4 -4 12]\n",
"n= False\n",
"[ True True True True]\n"
]
}
],
"source": [
"a=np.array([[1,-2,3,4],[5,6,-7,8]])\n",
"b = np.array(a)\n",
"a[:,1:].T\n",
"b\n",
"print(a)\n",
"print(np.maximum(a,0))\n",
"print(np.sum(a,axis=0))\n",
"s=np.sum(a,axis=0)\n",
"print(\"n=\",all_axis_equal(a))\n",
"a[a>0]=1\n",
"print(np.all(a,axis=0))"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a=[0,1,2]\n",
"a[0:1]\n",
"a[1:1+2]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1, 2],\n",
" [3, 4]])"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import numpy as np\n",
"np.reshape([1,2,3,4], (2,2))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}