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

773 lines
112 KiB
Plaintext

6 months ago
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "8f3ff90a",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import nnfs\n",
"from nnfs.datasets import spiral_data\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "439ab0e4",
"metadata": {},
"outputs": [],
"source": [
"nnfs.init()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2bc1bb6c",
"metadata": {},
"outputs": [],
"source": [
"class Stark_Layer():\n",
" def __init__(self, in_features, out_features):\n",
" self.weights = np.random.randn(in_features, out_features) * 0.1\n",
" self.bias = np.zeros((1, out_features))\n",
" def forward(self, inputs):\n",
" self.output = np.dot(inputs, self.weights) + self.bias\n",
" \n",
"class Activation_Relu():\n",
" def forward(self, inputs):\n",
" self.output = np.maximum(0, inputs)\n",
" \n",
"class Activation_Softmax():\n",
" def forward(self, inputs):\n",
" exp_values = np.exp(inputs - np.max(inputs, axis=1, keepdims=True))\n",
" self.output = exp_values / np.sum(exp_values, axis=1, keepdims=True)\n",
" \n",
"class Loss():\n",
" def calculate(self, output, y):\n",
" sample_loss = self.forward(output, y)\n",
" data_loss = np.mean(sample_loss)\n",
" return data_loss\n",
"\"\"\"交叉熵损失函数\"\"\"\n",
"class CategoricalCrossEntropy(Loss):\n",
" def one_hot(self, y_true):\n",
" y_hot = np.zeros((len(y_true), max(y_true) + 1))\n",
" y_hot[range(len(y_true)), y_true] = 1\n",
" return y_hot\n",
" def forward(self, y_pred, y_true):\n",
" samples = len(y_pred)\n",
" y_pred_clipped = np.clip(y_pred, 1e-7, 1-1e-7)#截断放置np.log溢出\n",
" if len(y_true.shape) == 1:#标签不是独热码通过one_hot函数转化\n",
" y_true = self.one_hot(y_true)\n",
" confidences = np.sum(y_pred_clipped * y_true, axis=1)\n",
" negative_log_likehoods = -np.log(confidences)\n",
" return negative_log_likehoods\n",
"\"\"\"准确率\"\"\"\n",
"class Accuracy():\n",
" def forward(self, logits, y_true):\n",
" predictions = np.argmax(logits, axis=1)#从激活输出选出最大值对应的下标即使标签\n",
" if len(y_true.shape) == 2:#独热编码\n",
" y_true = np.max(y_true, axis=1)\n",
" accuracy = np.mean(predictions == y_true)\n",
" return accuracy"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "5f334df4",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "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
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00\n",
" 0.00000000e+00]\n",
" [-8.35815910e-04 -7.90404272e-04 -1.33452227e-03 4.65504505e-04\n",
" 4.56846210e-05]\n",
" [-2.39994470e-03 5.93469958e-05 -2.24808278e-03 2.03573116e-04\n",
" 6.10024377e-04]\n",
" ...\n",
" [ 1.13291524e-01 -1.89262271e-01 -2.06855070e-02 8.11079666e-02\n",
" -6.71350807e-02]\n",
" [ 1.34588361e-01 -1.43197834e-01 3.09493970e-02 5.66337556e-02\n",
" -6.29687458e-02]\n",
" [ 1.07817926e-01 -2.00809643e-01 -3.37579325e-02 8.72561932e-02\n",
" -6.81458861e-02]]\n",
"[[ 0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [ 7.08149528e-05 -5.89407609e-05 5.18159613e-05]\n",
" [ 5.17934932e-05 -2.65439274e-04 1.97694186e-04]\n",
" [-1.89224535e-04 -6.32392417e-04 4.29261738e-04]\n",
" [-2.14097730e-04 -8.27776734e-04 5.66370611e-04]\n",
" [ 4.85953729e-04 5.82313623e-06 6.06857830e-05]\n",
" [-1.37065275e-04 -1.11884938e-03 7.85857614e-04]\n",
" [ 2.32653067e-04 -8.56984756e-04 6.47001201e-04]\n",
" [ 1.42646168e-04 -1.14675297e-03 8.43252114e-04]\n",
" [-2.42558395e-04 -1.70869916e-03 1.19572005e-03]\n",
" [-2.29702084e-04 -1.86581374e-03 1.31035980e-03]\n",
" [-1.11785089e-03 -2.28176848e-03 1.49075943e-03]\n",
" [-9.66162013e-04 -2.56620580e-03 1.71544333e-03]\n",
" [-7.48889870e-04 -2.71384534e-03 1.85056112e-03]\n",
" [-1.18494045e-03 -2.99108541e-03 1.99161330e-03]\n",
" [-1.33238628e-03 -3.19496565e-03 2.11846619e-03]\n",
" [-2.00261502e-03 -2.45510484e-03 1.49723305e-03]\n",
" [-1.40450499e-03 -3.63458320e-03 2.42480682e-03]\n",
" [-1.99408759e-03 -3.57176526e-03 2.30095279e-03]\n",
" [-1.33760308e-03 -4.04265290e-03 2.72703124e-03]\n",
" [ 3.88394692e-04 -2.82613724e-03 2.08308781e-03]\n",
" [-2.64272070e-03 -2.94574001e-03 1.76441984e-03]\n",
" [-2.72192573e-03 -2.29266612e-03 1.28446030e-03]\n",
" [-2.51633930e-03 -4.60413843e-03 2.97323801e-03]\n",
" [-1.39790063e-03 1.97816547e-03 -1.60838314e-03]\n",
" [-2.46393448e-03 -5.23386383e-03 3.43283825e-03]\n",
" [-3.21996654e-03 -2.73520174e-03 1.53604115e-03]\n",
" [-3.35280504e-03 -2.91778217e-03 1.64953491e-03]\n",
" [-1.51879631e-03 2.50279484e-03 -2.00159056e-03]\n",
" [-1.34117377e-03 2.97607714e-03 -2.31804349e-03]\n",
" [-3.03252041e-03 -3.56989534e-04 -1.48237610e-04]\n",
" [-2.57238094e-03 1.03617413e-03 -1.08812645e-03]\n",
" [-3.82467848e-03 -2.50660838e-03 1.29101903e-03]\n",
" [-4.12062230e-03 -5.16222324e-03 3.16019286e-03]\n",
" [-3.00923130e-03 7.03718280e-04 -9.07495269e-04]\n",
" [-1.82320201e-03 3.25614004e-03 -2.58368091e-03]\n",
" [ 9.50421148e-04 6.81887660e-03 -4.77408245e-03]\n",
" [ 1.36904290e-03 7.30110006e-03 -5.06479014e-03]\n",
" [-1.84271333e-03 3.76171712e-03 -2.94966088e-03]\n",
" [-1.22381886e-03 4.87840548e-03 -3.66964471e-03]\n",
" [-2.51951464e-03 2.95465742e-03 -2.45994749e-03]\n",
" [-2.95133889e-03 2.32138042e-03 -2.06243526e-03]\n",
" [-3.20323836e-03 2.01122276e-03 -1.87314115e-03]\n",
" [ 5.18313982e-03 7.66861346e-03 -4.81978152e-03]\n",
" [ 8.24465533e-04 8.04806687e-03 -5.67435659e-03]\n",
" [ 1.59917073e-03 8.83400906e-03 -6.13582321e-03]\n",
" [-1.16561474e-04 7.43323332e-03 -5.35807526e-03]\n",
" [ 5.26167359e-03 9.24981665e-03 -5.94576262e-03]\n",
" [ 8.07505330e-06 7.89896399e-03 -5.67617407e-03]\n",
" [ 4.43703122e-03 1.04166260e-02 -6.89447066e-03]\n",
" [ 3.35679553e-03 1.06002446e-02 -7.17064645e-03]\n",
" [ 6.19368022e-03 8.93488806e-03 -5.59499674e-03]\n",
" [ 5.35034249e-03 1.07382080e-02 -7.00368267e-03]\n",
" [ 4.41404525e-03 1.13293193e-02 -7.55352201e-03]\n",
" [ 6.69851573e-03 8.78598914e-03 -5.42058656e-03]\n",
" [ 6.83596823e-03 5.99988783e-03 -3.39977257e-03]\n",
" [ 7.02697691e-03 6.91157859e-03 -4.02953755e-03]\n",
" [ 6.85890438e-03 4.70445910e-03 -2.46564252e-03]\n",
" [ 7.28295138e-03 8.57739057e-03 -5.19264210e-03]\n",
" [ 7.32288277e-03 6.34372700e-03 -3.58190248e-03]\n",
" [ 7.50386575e-03 7.03886803e-03 -4.05736361e-03]\n",
" [ 7.15627801e-03 4.14312724e-03 -2.02249736e-03]\n",
" [ 7.57094193e-03 5.75502682e-03 -3.12566920e-03]\n",
" [ 7.88160972e-03 9.70722642e-03 -5.92477620e-03]\n",
" [ 4.73585073e-03 -3.36374971e-03 3.04983999e-03]\n",
" [ 5.96540328e-03 -8.29676224e-04 1.39265181e-03]\n",
" [ 8.06835014e-03 6.18329272e-03 -3.36707826e-03]\n",
" [ 1.53243705e-03 -9.16469842e-03 6.79154601e-03]\n",
" [ 5.93848154e-03 -1.59630238e-03 1.94005750e-03]\n",
" [ 1.60719466e-03 -9.39967204e-03 6.97040930e-03]\n",
" [-2.20942521e-03 -1.35399671e-02 9.43668932e-03]\n",
" [-4.86078556e-04 -1.21818762e-02 8.69063754e-03]\n",
" [-5.56112221e-03 -1.53886415e-02 1.03179682e-02]\n",
" [ 3.79260606e-03 -6.80829352e-03 5.39963366e-03]\n",
" [-4.41755401e-03 -1.55097395e-02 1.05576627e-02]\n",
" [-4.86538280e-04 -1.28407842e-02 9.16415546e-03]\n",
" [-5.69595897e-04 -1.30896438e-02 9.33193136e-03]\n",
" [-2.92492588e-03 -1.52456928e-02 1.05671380e-02]\n",
" [-5.05808648e-03 -1.64859220e-02 1.11737726e-02]\n",
" [-7.31163844e-03 -1.67471282e-02 1.10606784e-02]\n",
" [-3.13358777e-03 -1.59027781e-02 1.10115521e-02]\n",
" [-1.01219257e-02 -1.25985006e-02 7.70376762e-03]\n",
" [-1.00332061e-02 -1.40672242e-02 8.77123233e-03]\n",
" [-4.39246232e-03 -1.71524659e-02 1.17416959e-02]\n",
" [-9.39604733e-03 -3.87914013e-03 1.53376872e-03]\n",
" [-7.59703992e-03 1.58246630e-03 -2.15151813e-03]\n",
" [-9.37437825e-03 -3.11829057e-03 9.89813590e-04]\n",
" [-1.09345559e-02 -1.26644373e-02 7.64267985e-03]\n",
" [-1.02063818e-02 -1.67123917e-02 1.06492862e-02]\n",
" [-8.08499940e-03 1.34049030e-03 -2.04274082e-03]\n",
" [-1.12228030e-02 -1.01796770e-02 5.81831904e-03]\n",
" [-5.69388317e-03 6.79172110e-03 -5.64152841e-03]\n",
" [-9.25742928e-03 -9.74828203e-04 -5.35153376e-04]\n",
" [-4.99803340e-03 8.39229114e-03 -6.69902144e-03]\n",
" [-7.16295466e-03 4.51420527e-03 -4.20071045e-03]\n",
" [-4.37026238e-03 9.78642236e-03 -7.61722820e-03]\n",
" [-7.03254854e-03 5.19011356e-03 -4.66910051e-03]\n",
" [ 4.38707042e-03 1.96475219e-02 -1.35356961e-02]\n",
" [-4.35632002e-03 1.03370026e-02 -8.01108684e-03]\n",
" [-1.52134476e-03 1.44984992e-02 -1.06236478e-02]\n",
" [ 0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [-9.83056234e-05 -4.17087767e-06 -1.01252854e-05]\n",
" [-1.72812564e-04 5.12613769e-05 -5.99124251e-05]\n",
" [ 1.69111008e-04 6.24700508e-04 -4.26418264e-04]\n",
" [-2.43991555e-04 3.09998897e-04 -2.55377643e-04]\n",
" [ 5.75350190e-04 9.58377030e-04 -6.12013100e-04]\n",
" [ 5.72420831e-05 1.04564440e-03 -7.43898505e-04]\n",
" [ 8.77446291e-06 1.16013200e-03 -8.32654652e-04]\n",
" [ 9.99170588e-04 1.24930113e-03 -7.64533295e-04]\n",
" [ 1.09906949e-03 1.55299774e-03 -9.69474611e-04]\n",
" [ 1.25717185e-03 1.28455076e-03 -7.55427231e-04]\n",
" [ 1.30986772e-03 2.00948538e-03 -1.26942759e-03]\n",
" [ 6.68030290e-04 2.49511912e-03 -1.70414941e-03]\n",
" [ 1.52323942e-03 8.74682621e-04 -4.25323262e-04]\n",
" [ 1.44030584e-03 2.89118662e-03 -1.88572367e-03]\n",
" [ 1.88762404e-03 1.99661660e-03 -1.18305243e-03]\n",
" [ 1.97555544e-03 1.63572165e-03 -9.11926792e-04]\n",
" [ 2.07090122e-03 2.95409327e-03 -1.84675714e-03]\n",
" [ 2.20550434e-03 1.71925628e-03 -9.41269507e-04]\n",
" [ 2.11452693e-03 8.38789507e-04 -3.20593273e-04]\n",
" [ 2.39418168e-03 1.58568937e-03 -8.20083544e-04]\n",
" [ 2.50690943e-03 3.81895993e-03 -2.41016201e-03]\n",
" [ 2.45988555e-03 1.01240887e-03 -3.99276672e-04]\n",
" [ 1.33316359e-03 -1.90720719e-03 1.54874113e-03]\n",
" [ 2.97062192e-03 2.51121190e-03 -1.40833738e-03]\n",
" [ 2.67239800e-03 7.34348141e-04 -1.71056265e-04]\n",
" [ 2.84899445e-03 9.92920832e-04 -3.33326956e-04]\n",
" [-6.31590432e-04 -5.04729152e-03 3.54334619e-03]\n",
" [ 1.04338326e-03 -3.26241902e-03 2.48409412e-03]\n",
" [ 1.18959998e-03 -3.21397115e-03 2.46879179e-03]\n",
" [ 2.75998982e-03 -3.66234512e-04 6.31662377e-04]\n",
" [ 2.49715114e-04 -4.81393188e-03 3.49327014e-03]\n",
" [ 2.17298768e-03 -2.06755660e-03 1.77609967e-03]\n",
" [ 4.79641312e-04 -4.86698141e-03 3.56209185e-03]\n",
" [ 1.46168633e-03 -3.66434385e-03 2.82881130e-03]\n",
" [-1.75040273e-03 -7.18188705e-03 4.92819911e-03]\n",
" [-2.01042020e-03 -7.48815155e-03 5.11361146e-03]\n",
" [-7.79883121e-04 -6.84367260e-03 4.81466996e-03]\n",
" [-2.58682109e-03 -8.06528609e-03 5.45147201e-03]\n",
" [ 3.53704090e-04 -6.00973889e-03 4.36661858e-03]\n",
" [ 8.52819707e-04 -5.55336615e-03 4.10523638e-03]\n",
" [-4.03013919e-03 -8.58944468e-03 5.63553115e-03]\n",
" [-4.00915043e-03 -8.85715894e-03 5.83074801e-03]\n",
" [-5.03674336e-03 -8.06136895e-03 5.12161106e-03]\n",
" [-4.57027368e-03 -8.81346758e-04 2.33574119e-05]\n",
" [-5.66334231e-03 -6.28827885e-03 3.76358535e-03]\n",
" [-3.83997755e-03 -9.83238686e-03 6.55426085e-03]\n",
" [-5.70135098e-03 -4.13358165e-03 2.20985804e-03]\n",
" [-4.00909223e-03 -1.02597279e-02 6.83883019e-03]\n",
" [-5.86031191e-03 -8.87990091e-03 5.59997791e-03]\n",
" [-6.29244791e-03 -6.99757366e-03 4.18939907e-03]\n",
" [-3.61615513e-03 2.99690361e-03 -2.63670436e-03]\n",
" [-6.46627368e-03 -8.35200772e-03 5.13967173e-03]\n",
" [-6.64087664e-03 -8.04724544e-03 4.89732111e-03]\n",
" [-6.33825921e-03 -3.68190045e-03 1.80019718e-03]\n",
" [-6.80095516e-03 -5.70077123e-03 3.18946131e-03]\n",
" [-2.65827938e-03 5.63670322e-03 -4.40614857e-03]\n",
" [-7.05645140e-03 -5.97413024e-03 3.35182715e-03]\n",
" [-7.07531627e-03 -5.33876708e-03 2.89265160e-03]\n",
" [-5.65651851e-03 1.37083945e-04 -8.53628444e-04]\n",
" [-5.39124757e-03 1.04801182e-03 -1.47293159e-03]\n",
" [ 3.81390844e-03 1.28473723e-02 -8.72471277e-03]\n",
" [ 1.01761054e-03 1.12103624e-02 -7.92142190e-03]\n",
" [-1.56889856e-03 8.44620541e-03 -6.28000824e-03]\n",
" [-5.51847648e-03 1.66707090e-03 -1.93485431e-03]\n",
" [ 3.04439990e-03 1.32258693e-02 -9.09947418e-03]\n",
" [-3.53861437e-03 5.97008131e-03 -4.76327632e-03]\n",
" [-4.84009320e-03 3.75913596e-03 -3.34793283e-03]\n",
" [ 6.46498054e-03 1.43512338e-02 -9.45169106e-03]\n",
" [ 4.32754960e-03 1.45368204e-02 -9.87040810e-03]\n",
" [ 7.03441491e-03 1.45735582e-02 -9.53546725e-03]\n",
" [ 5.92314033e-03 1.51763391e-02 -1.01170531e-02]\n",
" [ 8.05442967e-03 1.41786402e-02 -9.11546312e-03]\n",
" [ 3.92758055e-03 1.51164904e-02 -1.03404298e-02]\n",
" [ 3.20318481e-03 1.49031794e-02 -1.02838175e-02]\n",
" [ 9.12118051e-03 1.30913723e-02 -8.19160324e-03]\n",
" [ 5.92924235e-03 1.62473302e-02 -1.08859958e-02]\n",
" [ 7.12879421e-03 1.63224023e-02 -1.07798222e-02]\n",
" [ 8.48918036e-03 1.56667382e-02 -1.01269735e-02]\n",
" [ 9.76718124e-03 1.30519113e-02 -8.07700586e-03]\n",
" [ 9.69537906e-03 1.40889483e-02 -8.83194432e-03]\n",
" [ 7.90846255e-03 1.69978645e-02 -1.11612193e-02]\n",
" [ 1.00809392e-02 1.38487751e-02 -8.60785507e-03]\n",
" [ 6.45133853e-03 1.77423917e-02 -1.18908519e-02]\n",
" [ 8.60477984e-03 1.32717274e-03 1.94787790e-04]\n",
" [ 9.88541078e-03 1.60876624e-02 -1.02431178e-02]\n",
" [ 1.08151836e-02 1.23565355e-02 -7.43731530e-03]\n",
" [ 8.80590174e-03 1.06830918e-03 4.07689920e-04]\n",
" [ 1.04362490e-02 6.49369042e-03 -3.27407499e-03]\n",
" [-1.48359701e-04 -1.47896819e-02 1.06100384e-02]\n",
" [ 1.09267877e-02 7.96962716e-03 -4.26939735e-03]\n",
" [ 4.69906488e-03 -8.53517000e-03 6.76180329e-03]\n",
" [ 5.29481797e-03 -7.69546395e-03 6.23780675e-03]\n",
" [ 9.44144093e-03 1.22276030e-03 3.81520047e-04]\n",
" [-9.96858071e-05 -1.55594163e-02 1.11697698e-02]\n",
" [ 2.81891134e-03 -1.21124964e-02 9.08196252e-03]\n",
" [-3.96937458e-03 -1.92183666e-02 1.32830068e-02]\n",
" [-5.43760927e-03 -2.01854650e-02 1.37820961e-02]\n",
" [-1.16361333e-02 -1.79925375e-02 1.13785081e-02]\n",
" [-9.91506688e-03 -2.06325687e-02 1.35057392e-02]\n",
" [ 0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [-2.90830067e-05 -1.91536776e-04 1.33781577e-04]\n",
" [-2.12336425e-04 -4.07360960e-04 2.64438771e-04]\n",
" [-2.91645236e-04 -6.30193041e-04 4.14008566e-04]\n",
" [-4.17006406e-04 -8.21638911e-04 5.34872466e-04]\n",
" [ 3.24545108e-05 -7.85532407e-04 5.68921037e-04]\n",
" [-5.65262686e-04 -1.26836961e-03 8.36161838e-04]\n",
" [-4.90135688e-04 -1.48884114e-03 1.00465096e-03]\n",
" [-9.38502024e-04 -1.49656169e-03 9.50346526e-04]\n",
" [-1.01562706e-03 -1.75909838e-03 1.12874492e-03]\n",
" [-1.24529214e-03 -1.11378415e-03 6.34277414e-04]\n",
" [-1.38292077e-03 -1.59186427e-03 9.59517260e-04]\n",
" [-1.44897692e-03 -1.01754710e-03 5.37918182e-04]\n",
" [-1.58981688e-03 -2.23366427e-03 1.39318150e-03]\n",
" [-1.63843553e-03 -2.62781885e-03 1.66998338e-03]\n",
" [-1.88801577e-03 -2.07355013e-03 1.23829488e-03]\n",
" [-1.93061808e-03 -1.34929316e-03 7.12059846e-04]\n",
" [-1.78070390e-03 -3.85572086e-04 3.94133713e-05]\n",
" [ 1.31520690e-04 3.09676211e-03 -2.20819027e-03]\n",
" [-2.00164015e-03 -4.66003199e-04 6.77287026e-05]\n",
" [-2.45496538e-03 -1.93996006e-03 1.06659578e-03]\n",
" [-2.13702768e-03 -2.90736498e-04 -7.63144853e-05]\n",
" [-2.16803513e-03 -1.06232452e-04 -2.13063176e-04]\n",
" [-9.26567183e-04 2.57492228e-03 -1.97437289e-03]\n",
" [-2.85312370e-03 -1.80399162e-03 9.15719720e-04]\n",
" [-1.02824881e-03 2.76646507e-03 -2.12561479e-03]\n",
" [-6.02769665e-04 3.54568893e-03 -2.62887124e-03]\n",
" [-1.57609582e-04 4.26218007e-03 -3.08441184e-03]\n",
" [-1.24199758e-03 2.95763765e-03 -2.29155109e-03]\n",
" [-2.89614487e-04 4.43723192e-03 -3.22784949e-03]\n",
" [-2.04245863e-03 1.92816567e-03 -1.65849004e-03]\n",
" [-1.99086080e-05 5.07404981e-03 -3.64954816e-03]\n",
" [ 2.86293682e-04 5.55795198e-03 -3.95646971e-03]\n",
" [ 2.51911883e-03 7.05071026e-03 -4.73130029e-03]\n",
" [-1.43355282e-04 5.42996265e-03 -3.92183382e-03]\n",
" [ 3.79084959e-03 7.05091609e-03 -4.56168177e-03]\n",
" [ 4.51800646e-03 5.36476402e-03 -3.25271767e-03]\n",
" [-8.67557304e-04 5.03276614e-03 -3.73303075e-03]\n",
" [ 4.38856613e-03 7.25357374e-03 -4.62754816e-03]\n",
" [ 4.82732663e-03 6.41079247e-03 -3.96324182e-03]\n",
" [ 3.72196594e-03 8.47283471e-03 -5.59285842e-03]\n",
" [ 4.48432006e-03 8.20898078e-03 -5.30144898e-03]\n",
" [ 5.07403724e-03 7.45235803e-03 -4.67891619e-03]\n",
" [ 5.22214640e-03 7.53325038e-03 -4.71728481e-03]\n",
" [ 5.45798149e-03 7.15939561e-03 -4.41710046e-03]\n",
" [ 4.13249666e-03 9.54979844e-03 -6.31210580e-03]\n",
" [ 4.18860093e-03 -6.68719469e-04 1.03977718e-03]\n",
" [ 4.00681747e-03 -1.32970582e-03 1.49058376e-03]\n",
" [ 6.04082318e-03 6.71269791e-03 -4.01823921e-03]\n",
" [ 5.98466489e-03 8.45171884e-03 -5.27562853e-03]\n",
" [ 4.15139273e-03 -1.66591001e-03 1.75152463e-03]\n",
" [ 5.90505311e-03 3.12891789e-03 -1.46057981e-03]\n",
" [ 4.25579585e-03 -1.86932203e-03 1.91166066e-03]\n",
" [ 4.95644799e-03 -4.45001409e-04 9.81485122e-04]\n",
" [ 1.55642722e-03 -6.94920076e-03 5.20239584e-03]\n",
" [ 8.86594353e-04 -8.00291169e-03 5.87031571e-03]\n",
" [ 4.74035973e-03 -1.66125142e-03 1.82679889e-03]\n",
" [ 5.89984143e-03 1.07985095e-03 1.14582181e-05]\n",
" [ 5.99826267e-03 1.08368625e-03 2.18397217e-05]\n",
" [-1.71791937e-03 -1.13022393e-02 7.89397117e-03]\n",
" [ 4.04474512e-03 -3.93348886e-03 3.36707337e-03]\n",
" [ 9.43109102e-04 -8.92628636e-03 6.54152082e-03]\n",
" [ 5.21539536e-04 -9.60194413e-03 6.97086239e-03]\n",
" [-2.38891598e-03 -1.24709150e-02 8.64436477e-03]\n",
" [ 4.10610251e-03 -4.58885543e-03 3.84629797e-03]\n",
" [-4.81160544e-03 -1.38706118e-02 9.32696369e-03]\n",
" [-6.49340823e-03 -1.38236955e-02 9.06873681e-03]\n",
" [-5.93431806e-03 -1.42744221e-02 9.46732238e-03]\n",
" [-5.39465994e-03 -1.45407589e-02 9.73078795e-03]\n",
" [-7.24696834e-03 -1.41268140e-02 9.18600336e-03]\n",
" [-8.33017752e-03 -1.28021361e-02 8.08931235e-03]\n",
" [ 2.17575347e-03 -8.95529240e-03 6.72691688e-03]\n",
" [-7.22277490e-03 -7.00454984e-04 -4.60744166e-04]\n",
" [-9.18358844e-03 -1.03803640e-02 6.23477949e-03]\n",
" [-8.37263651e-03 -1.44291893e-02 9.25306231e-03]\n",
" [-9.20905173e-03 -1.27206417e-02 7.91341625e-03]\n",
" [-9.07618180e-03 -5.91586903e-03 3.04033398e-03]\n",
" [-9.62527003e-03 -8.97529256e-03 5.16594574e-03]\n",
" [-7.25894049e-03 -1.65216438e-02 1.09056495e-02]\n",
" [-1.59304682e-03 1.10870013e-02 -8.18126090e-03]\n",
" [-9.18064546e-03 -4.57402924e-03 2.06196331e-03]\n",
" [-4.71752090e-03 6.67700451e-03 -5.42874075e-03]\n",
" [-9.74893849e-03 -6.16734568e-03 3.13127134e-03]\n",
" [-2.18478541e-04 1.34030515e-02 -9.66238976e-03]\n",
" [-5.48066897e-03 5.85199846e-03 -4.93765576e-03]\n",
" [-2.98411888e-03 1.01748146e-02 -7.71133928e-03]\n",
" [-9.15949233e-03 -2.41966615e-03 5.16373606e-04]\n",
" [ 2.39527342e-03 1.65577214e-02 -1.15808416e-02]\n",
" [ 6.73688308e-04 1.51706999e-02 -1.08137615e-02]\n",
" [ 5.05236210e-03 1.85479950e-02 -1.26566179e-02]\n",
" [-4.37055435e-03 8.89915414e-03 -6.97955722e-03]\n",
" [-2.51684664e-03 1.18577844e-02 -8.85856897e-03]\n",
" [ 1.10669956e-02 1.64793786e-02 -1.03669269e-02]\n",
" [-3.56001477e-03 1.06943855e-02 -8.16165004e-03]\n",
" [ 2.97351344e-03 1.81871578e-02 -1.26747824e-02]\n",
" [ 1.00067127e-02 1.94238611e-02 -1.26247648e-02]\n",
" [ 6.55017979e-03 2.03791559e-02 -1.37727885e-02]\n",
" [ 9.68818273e-03 2.02322882e-02 -1.32483300e-02]\n",
" [ 6.19685696e-03 2.06632651e-02 -1.40241515e-02]\n",
" [ 1.05665131e-02 2.01094653e-02 -1.30428020e-02]]\n",
"[[0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [7.08149528e-05 0.00000000e+00 5.18159613e-05]\n",
" [5.17934932e-05 0.00000000e+00 1.97694186e-04]\n",
" [0.00000000e+00 0.00000000e+00 4.29261738e-04]\n",
" [0.00000000e+00 0.00000000e+00 5.66370611e-04]\n",
" [4.85953729e-04 5.82313623e-06 6.06857830e-05]\n",
" [0.00000000e+00 0.00000000e+00 7.85857614e-04]\n",
" [2.32653067e-04 0.00000000e+00 6.47001201e-04]\n",
" [1.42646168e-04 0.00000000e+00 8.43252114e-04]\n",
" [0.00000000e+00 0.00000000e+00 1.19572005e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.31035980e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.49075943e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.71544333e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.85056112e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.99161330e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.11846619e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.49723305e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.42480682e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.30095279e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.72703124e-03]\n",
" [3.88394692e-04 0.00000000e+00 2.08308781e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.76441984e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.28446030e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.97323801e-03]\n",
" [0.00000000e+00 1.97816547e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 3.43283825e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.53604115e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.64953491e-03]\n",
" [0.00000000e+00 2.50279484e-03 0.00000000e+00]\n",
" [0.00000000e+00 2.97607714e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 1.03617413e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 1.29101903e-03]\n",
" [0.00000000e+00 0.00000000e+00 3.16019286e-03]\n",
" [0.00000000e+00 7.03718280e-04 0.00000000e+00]\n",
" [0.00000000e+00 3.25614004e-03 0.00000000e+00]\n",
" [9.50421148e-04 6.81887660e-03 0.00000000e+00]\n",
" [1.36904290e-03 7.30110006e-03 0.00000000e+00]\n",
" [0.00000000e+00 3.76171712e-03 0.00000000e+00]\n",
" [0.00000000e+00 4.87840548e-03 0.00000000e+00]\n",
" [0.00000000e+00 2.95465742e-03 0.00000000e+00]\n",
" [0.00000000e+00 2.32138042e-03 0.00000000e+00]\n",
" [0.00000000e+00 2.01122276e-03 0.00000000e+00]\n",
" [5.18313982e-03 7.66861346e-03 0.00000000e+00]\n",
" [8.24465533e-04 8.04806687e-03 0.00000000e+00]\n",
" [1.59917073e-03 8.83400906e-03 0.00000000e+00]\n",
" [0.00000000e+00 7.43323332e-03 0.00000000e+00]\n",
" [5.26167359e-03 9.24981665e-03 0.00000000e+00]\n",
" [8.07505330e-06 7.89896399e-03 0.00000000e+00]\n",
" [4.43703122e-03 1.04166260e-02 0.00000000e+00]\n",
" [3.35679553e-03 1.06002446e-02 0.00000000e+00]\n",
" [6.19368022e-03 8.93488806e-03 0.00000000e+00]\n",
" [5.35034249e-03 1.07382080e-02 0.00000000e+00]\n",
" [4.41404525e-03 1.13293193e-02 0.00000000e+00]\n",
" [6.69851573e-03 8.78598914e-03 0.00000000e+00]\n",
" [6.83596823e-03 5.99988783e-03 0.00000000e+00]\n",
" [7.02697691e-03 6.91157859e-03 0.00000000e+00]\n",
" [6.85890438e-03 4.70445910e-03 0.00000000e+00]\n",
" [7.28295138e-03 8.57739057e-03 0.00000000e+00]\n",
" [7.32288277e-03 6.34372700e-03 0.00000000e+00]\n",
" [7.50386575e-03 7.03886803e-03 0.00000000e+00]\n",
" [7.15627801e-03 4.14312724e-03 0.00000000e+00]\n",
" [7.57094193e-03 5.75502682e-03 0.00000000e+00]\n",
" [7.88160972e-03 9.70722642e-03 0.00000000e+00]\n",
" [4.73585073e-03 0.00000000e+00 3.04983999e-03]\n",
" [5.96540328e-03 0.00000000e+00 1.39265181e-03]\n",
" [8.06835014e-03 6.18329272e-03 0.00000000e+00]\n",
" [1.53243705e-03 0.00000000e+00 6.79154601e-03]\n",
" [5.93848154e-03 0.00000000e+00 1.94005750e-03]\n",
" [1.60719466e-03 0.00000000e+00 6.97040930e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.43668932e-03]\n",
" [0.00000000e+00 0.00000000e+00 8.69063754e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.03179682e-02]\n",
" [3.79260606e-03 0.00000000e+00 5.39963366e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.05576627e-02]\n",
" [0.00000000e+00 0.00000000e+00 9.16415546e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.33193136e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.05671380e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.11737726e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.10606784e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.10115521e-02]\n",
" [0.00000000e+00 0.00000000e+00 7.70376762e-03]\n",
" [0.00000000e+00 0.00000000e+00 8.77123233e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.17416959e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.53376872e-03]\n",
" [0.00000000e+00 1.58246630e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 9.89813590e-04]\n",
" [0.00000000e+00 0.00000000e+00 7.64267985e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.06492862e-02]\n",
" [0.00000000e+00 1.34049030e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 5.81831904e-03]\n",
" [0.00000000e+00 6.79172110e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 8.39229114e-03 0.00000000e+00]\n",
" [0.00000000e+00 4.51420527e-03 0.00000000e+00]\n",
" [0.00000000e+00 9.78642236e-03 0.00000000e+00]\n",
" [0.00000000e+00 5.19011356e-03 0.00000000e+00]\n",
" [4.38707042e-03 1.96475219e-02 0.00000000e+00]\n",
" [0.00000000e+00 1.03370026e-02 0.00000000e+00]\n",
" [0.00000000e+00 1.44984992e-02 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 5.12613769e-05 0.00000000e+00]\n",
" [1.69111008e-04 6.24700508e-04 0.00000000e+00]\n",
" [0.00000000e+00 3.09998897e-04 0.00000000e+00]\n",
" [5.75350190e-04 9.58377030e-04 0.00000000e+00]\n",
" [5.72420831e-05 1.04564440e-03 0.00000000e+00]\n",
" [8.77446291e-06 1.16013200e-03 0.00000000e+00]\n",
" [9.99170588e-04 1.24930113e-03 0.00000000e+00]\n",
" [1.09906949e-03 1.55299774e-03 0.00000000e+00]\n",
" [1.25717185e-03 1.28455076e-03 0.00000000e+00]\n",
" [1.30986772e-03 2.00948538e-03 0.00000000e+00]\n",
" [6.68030290e-04 2.49511912e-03 0.00000000e+00]\n",
" [1.52323942e-03 8.74682621e-04 0.00000000e+00]\n",
" [1.44030584e-03 2.89118662e-03 0.00000000e+00]\n",
" [1.88762404e-03 1.99661660e-03 0.00000000e+00]\n",
" [1.97555544e-03 1.63572165e-03 0.00000000e+00]\n",
" [2.07090122e-03 2.95409327e-03 0.00000000e+00]\n",
" [2.20550434e-03 1.71925628e-03 0.00000000e+00]\n",
" [2.11452693e-03 8.38789507e-04 0.00000000e+00]\n",
" [2.39418168e-03 1.58568937e-03 0.00000000e+00]\n",
" [2.50690943e-03 3.81895993e-03 0.00000000e+00]\n",
" [2.45988555e-03 1.01240887e-03 0.00000000e+00]\n",
" [1.33316359e-03 0.00000000e+00 1.54874113e-03]\n",
" [2.97062192e-03 2.51121190e-03 0.00000000e+00]\n",
" [2.67239800e-03 7.34348141e-04 0.00000000e+00]\n",
" [2.84899445e-03 9.92920832e-04 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 3.54334619e-03]\n",
" [1.04338326e-03 0.00000000e+00 2.48409412e-03]\n",
" [1.18959998e-03 0.00000000e+00 2.46879179e-03]\n",
" [2.75998982e-03 0.00000000e+00 6.31662377e-04]\n",
" [2.49715114e-04 0.00000000e+00 3.49327014e-03]\n",
" [2.17298768e-03 0.00000000e+00 1.77609967e-03]\n",
" [4.79641312e-04 0.00000000e+00 3.56209185e-03]\n",
" [1.46168633e-03 0.00000000e+00 2.82881130e-03]\n",
" [0.00000000e+00 0.00000000e+00 4.92819911e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.11361146e-03]\n",
" [0.00000000e+00 0.00000000e+00 4.81466996e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.45147201e-03]\n",
" [3.53704090e-04 0.00000000e+00 4.36661858e-03]\n",
" [8.52819707e-04 0.00000000e+00 4.10523638e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.63553115e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.83074801e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.12161106e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.33574119e-05]\n",
" [0.00000000e+00 0.00000000e+00 3.76358535e-03]\n",
" [0.00000000e+00 0.00000000e+00 6.55426085e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.20985804e-03]\n",
" [0.00000000e+00 0.00000000e+00 6.83883019e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.59997791e-03]\n",
" [0.00000000e+00 0.00000000e+00 4.18939907e-03]\n",
" [0.00000000e+00 2.99690361e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 5.13967173e-03]\n",
" [0.00000000e+00 0.00000000e+00 4.89732111e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.80019718e-03]\n",
" [0.00000000e+00 0.00000000e+00 3.18946131e-03]\n",
" [0.00000000e+00 5.63670322e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 3.35182715e-03]\n",
" [0.00000000e+00 0.00000000e+00 2.89265160e-03]\n",
" [0.00000000e+00 1.37083945e-04 0.00000000e+00]\n",
" [0.00000000e+00 1.04801182e-03 0.00000000e+00]\n",
" [3.81390844e-03 1.28473723e-02 0.00000000e+00]\n",
" [1.01761054e-03 1.12103624e-02 0.00000000e+00]\n",
" [0.00000000e+00 8.44620541e-03 0.00000000e+00]\n",
" [0.00000000e+00 1.66707090e-03 0.00000000e+00]\n",
" [3.04439990e-03 1.32258693e-02 0.00000000e+00]\n",
" [0.00000000e+00 5.97008131e-03 0.00000000e+00]\n",
" [0.00000000e+00 3.75913596e-03 0.00000000e+00]\n",
" [6.46498054e-03 1.43512338e-02 0.00000000e+00]\n",
" [4.32754960e-03 1.45368204e-02 0.00000000e+00]\n",
" [7.03441491e-03 1.45735582e-02 0.00000000e+00]\n",
" [5.92314033e-03 1.51763391e-02 0.00000000e+00]\n",
" [8.05442967e-03 1.41786402e-02 0.00000000e+00]\n",
" [3.92758055e-03 1.51164904e-02 0.00000000e+00]\n",
" [3.20318481e-03 1.49031794e-02 0.00000000e+00]\n",
" [9.12118051e-03 1.30913723e-02 0.00000000e+00]\n",
" [5.92924235e-03 1.62473302e-02 0.00000000e+00]\n",
" [7.12879421e-03 1.63224023e-02 0.00000000e+00]\n",
" [8.48918036e-03 1.56667382e-02 0.00000000e+00]\n",
" [9.76718124e-03 1.30519113e-02 0.00000000e+00]\n",
" [9.69537906e-03 1.40889483e-02 0.00000000e+00]\n",
" [7.90846255e-03 1.69978645e-02 0.00000000e+00]\n",
" [1.00809392e-02 1.38487751e-02 0.00000000e+00]\n",
" [6.45133853e-03 1.77423917e-02 0.00000000e+00]\n",
" [8.60477984e-03 1.32717274e-03 1.94787790e-04]\n",
" [9.88541078e-03 1.60876624e-02 0.00000000e+00]\n",
" [1.08151836e-02 1.23565355e-02 0.00000000e+00]\n",
" [8.80590174e-03 1.06830918e-03 4.07689920e-04]\n",
" [1.04362490e-02 6.49369042e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 1.06100384e-02]\n",
" [1.09267877e-02 7.96962716e-03 0.00000000e+00]\n",
" [4.69906488e-03 0.00000000e+00 6.76180329e-03]\n",
" [5.29481797e-03 0.00000000e+00 6.23780675e-03]\n",
" [9.44144093e-03 1.22276030e-03 3.81520047e-04]\n",
" [0.00000000e+00 0.00000000e+00 1.11697698e-02]\n",
" [2.81891134e-03 0.00000000e+00 9.08196252e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.32830068e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.37820961e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.13785081e-02]\n",
" [0.00000000e+00 0.00000000e+00 1.35057392e-02]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 1.33781577e-04]\n",
" [0.00000000e+00 0.00000000e+00 2.64438771e-04]\n",
" [0.00000000e+00 0.00000000e+00 4.14008566e-04]\n",
" [0.00000000e+00 0.00000000e+00 5.34872466e-04]\n",
" [3.24545108e-05 0.00000000e+00 5.68921037e-04]\n",
" [0.00000000e+00 0.00000000e+00 8.36161838e-04]\n",
" [0.00000000e+00 0.00000000e+00 1.00465096e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.50346526e-04]\n",
" [0.00000000e+00 0.00000000e+00 1.12874492e-03]\n",
" [0.00000000e+00 0.00000000e+00 6.34277414e-04]\n",
" [0.00000000e+00 0.00000000e+00 9.59517260e-04]\n",
" [0.00000000e+00 0.00000000e+00 5.37918182e-04]\n",
" [0.00000000e+00 0.00000000e+00 1.39318150e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.66998338e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.23829488e-03]\n",
" [0.00000000e+00 0.00000000e+00 7.12059846e-04]\n",
" [0.00000000e+00 0.00000000e+00 3.94133713e-05]\n",
" [1.31520690e-04 3.09676211e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 6.77287026e-05]\n",
" [0.00000000e+00 0.00000000e+00 1.06659578e-03]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 2.57492228e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 9.15719720e-04]\n",
" [0.00000000e+00 2.76646507e-03 0.00000000e+00]\n",
" [0.00000000e+00 3.54568893e-03 0.00000000e+00]\n",
" [0.00000000e+00 4.26218007e-03 0.00000000e+00]\n",
" [0.00000000e+00 2.95763765e-03 0.00000000e+00]\n",
" [0.00000000e+00 4.43723192e-03 0.00000000e+00]\n",
" [0.00000000e+00 1.92816567e-03 0.00000000e+00]\n",
" [0.00000000e+00 5.07404981e-03 0.00000000e+00]\n",
" [2.86293682e-04 5.55795198e-03 0.00000000e+00]\n",
" [2.51911883e-03 7.05071026e-03 0.00000000e+00]\n",
" [0.00000000e+00 5.42996265e-03 0.00000000e+00]\n",
" [3.79084959e-03 7.05091609e-03 0.00000000e+00]\n",
" [4.51800646e-03 5.36476402e-03 0.00000000e+00]\n",
" [0.00000000e+00 5.03276614e-03 0.00000000e+00]\n",
" [4.38856613e-03 7.25357374e-03 0.00000000e+00]\n",
" [4.82732663e-03 6.41079247e-03 0.00000000e+00]\n",
" [3.72196594e-03 8.47283471e-03 0.00000000e+00]\n",
" [4.48432006e-03 8.20898078e-03 0.00000000e+00]\n",
" [5.07403724e-03 7.45235803e-03 0.00000000e+00]\n",
" [5.22214640e-03 7.53325038e-03 0.00000000e+00]\n",
" [5.45798149e-03 7.15939561e-03 0.00000000e+00]\n",
" [4.13249666e-03 9.54979844e-03 0.00000000e+00]\n",
" [4.18860093e-03 0.00000000e+00 1.03977718e-03]\n",
" [4.00681747e-03 0.00000000e+00 1.49058376e-03]\n",
" [6.04082318e-03 6.71269791e-03 0.00000000e+00]\n",
" [5.98466489e-03 8.45171884e-03 0.00000000e+00]\n",
" [4.15139273e-03 0.00000000e+00 1.75152463e-03]\n",
" [5.90505311e-03 3.12891789e-03 0.00000000e+00]\n",
" [4.25579585e-03 0.00000000e+00 1.91166066e-03]\n",
" [4.95644799e-03 0.00000000e+00 9.81485122e-04]\n",
" [1.55642722e-03 0.00000000e+00 5.20239584e-03]\n",
" [8.86594353e-04 0.00000000e+00 5.87031571e-03]\n",
" [4.74035973e-03 0.00000000e+00 1.82679889e-03]\n",
" [5.89984143e-03 1.07985095e-03 1.14582181e-05]\n",
" [5.99826267e-03 1.08368625e-03 2.18397217e-05]\n",
" [0.00000000e+00 0.00000000e+00 7.89397117e-03]\n",
" [4.04474512e-03 0.00000000e+00 3.36707337e-03]\n",
" [9.43109102e-04 0.00000000e+00 6.54152082e-03]\n",
" [5.21539536e-04 0.00000000e+00 6.97086239e-03]\n",
" [0.00000000e+00 0.00000000e+00 8.64436477e-03]\n",
" [4.10610251e-03 0.00000000e+00 3.84629797e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.32696369e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.06873681e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.46732238e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.73078795e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.18600336e-03]\n",
" [0.00000000e+00 0.00000000e+00 8.08931235e-03]\n",
" [2.17575347e-03 0.00000000e+00 6.72691688e-03]\n",
" [0.00000000e+00 0.00000000e+00 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 6.23477949e-03]\n",
" [0.00000000e+00 0.00000000e+00 9.25306231e-03]\n",
" [0.00000000e+00 0.00000000e+00 7.91341625e-03]\n",
" [0.00000000e+00 0.00000000e+00 3.04033398e-03]\n",
" [0.00000000e+00 0.00000000e+00 5.16594574e-03]\n",
" [0.00000000e+00 0.00000000e+00 1.09056495e-02]\n",
" [0.00000000e+00 1.10870013e-02 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 2.06196331e-03]\n",
" [0.00000000e+00 6.67700451e-03 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 3.13127134e-03]\n",
" [0.00000000e+00 1.34030515e-02 0.00000000e+00]\n",
" [0.00000000e+00 5.85199846e-03 0.00000000e+00]\n",
" [0.00000000e+00 1.01748146e-02 0.00000000e+00]\n",
" [0.00000000e+00 0.00000000e+00 5.16373606e-04]\n",
" [2.39527342e-03 1.65577214e-02 0.00000000e+00]\n",
" [6.73688308e-04 1.51706999e-02 0.00000000e+00]\n",
" [5.05236210e-03 1.85479950e-02 0.00000000e+00]\n",
" [0.00000000e+00 8.89915414e-03 0.00000000e+00]\n",
" [0.00000000e+00 1.18577844e-02 0.00000000e+00]\n",
" [1.10669956e-02 1.64793786e-02 0.00000000e+00]\n",
" [0.00000000e+00 1.06943855e-02 0.00000000e+00]\n",
" [2.97351344e-03 1.81871578e-02 0.00000000e+00]\n",
" [1.00067127e-02 1.94238611e-02 0.00000000e+00]\n",
" [6.55017979e-03 2.03791559e-02 0.00000000e+00]\n",
" [9.68818273e-03 2.02322882e-02 0.00000000e+00]\n",
" [6.19685696e-03 2.06632651e-02 0.00000000e+00]\n",
" [1.05665131e-02 2.01094653e-02 0.00000000e+00]]\n",
"1.0990554\n",
"0.3433333333333333\n"
]
}
],
"source": [
"if \"__main__\" == __name__:\n",
" #数据34batch_size, in_features\n",
" X, y = spiral_data(100, 3)#每个类别100个数据3个类别就是300\n",
" plt.scatter(X[:, 0], X[:, 1], c=y, cmap='brg')\n",
" plt.show()\n",
" layer1 = Stark_Layer(2, 5)\n",
" layer2 = Stark_Layer(5, 3)\n",
" layer1.forward(X)\n",
" print(layer1.output)\n",
" layer2.forward(layer1.output)\n",
" print(layer2.output)\n",
" act1 = Activation_Relu()\n",
" act1.forward(layer2.output)\n",
" print(act1.output)\n",
" act2 = Activation_Softmax()\n",
" act2.forward(layer2.output)\n",
" act2.output, np.sum(act2.output, axis=1)\n",
" loss = CategoricalCrossEntropy()\n",
" cost = loss.calculate(act2.output, y)\n",
" print(cost)\n",
" acc = Accuracy()\n",
" accuracy = acc.forward(act2.output, y)\n",
" print(accuracy)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "15290c5d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}