From f66a70fee5e7a4f57db3bd289d667981acd0781f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerardo=20Marx=20Cha=CC=81vez-Campos?= Date: Tue, 24 Oct 2023 08:03:17 -0600 Subject: [PATCH] development --- main.ipynb | 1127 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1127 insertions(+) create mode 100644 main.ipynb diff --git a/main.ipynb b/main.ipynb new file mode 100644 index 0000000..61ca523 --- /dev/null +++ b/main.ipynb @@ -0,0 +1,1127 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d11e7334", + "metadata": {}, + "source": [ + "# ANN - Example 3" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "2b74c408", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "W = np.array([[0.9, 0.3, 0.4],\n", + " [0.2, 0.8, 0.2],\n", + " [0.1, 0.5, 0.6]])\n", + "I = np.array([[0.9],[0.1], [0.8]])\n", + "\n", + "def mySigmoid(x):\n", + " return 1/(1+np.exp(-x))" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "a24d741f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1.16],\n", + " [0.42],\n", + " [0.62]])" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Xih = np.dot(W,I)\n", + "Xih" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "e977d118", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.76133271],\n", + " [0.60348325],\n", + " [0.65021855]])" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Oh = mySigmoid(Xih)\n", + "Oh" + ] + }, + { + "cell_type": "markdown", + "id": "9801c7d7", + "metadata": {}, + "source": [ + "# Creating Class and Methods\n", + "A class defines the structure, data and methods that an object will have. There is possible to have public and private variables to operate in the methods.\n", + "\n", + "\n", + "- Argument\n", + "- Initialitation\n", + "- Methods\n", + "- Destroy" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ec1cead5", + "metadata": {}, + "outputs": [], + "source": [ + "class Dog:\n", + " # init method\n", + " def __init__(self, dogName, dogAge):\n", + " self.name=dogName\n", + " self.age=dogAge\n", + " \n", + " # status method\n", + " def status(self):\n", + " print(\"The Dogs name is: \", self.name)\n", + " print(\"The Dogs age is: \", self.age)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "5a484af0", + "metadata": {}, + "outputs": [], + "source": [ + "perro1=Dog('cuadrado', 9)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "62857352", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Dogs name is: cuadrado\n", + "The Dogs age is: 9\n" + ] + } + ], + "source": [ + "perro1.status()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "7e848bc3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cuadrado\n", + "9\n" + ] + } + ], + "source": [ + "print(perro1.name)\n", + "print(perro1.age)" + ] + }, + { + "cell_type": "markdown", + "id": "9fb56224", + "metadata": {}, + "source": [ + "# The Neural Notwork Class\n", + "\n", + "The next chunk of code defines the Neural Network's basic structure. We are going to implement and define the methods one at tima to understand them in a better way.\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0a8eb25f", + "metadata": {}, + "outputs": [], + "source": [ + "class NeuralNetwork:\n", + " # init method\n", + " def __init__():\n", + " pass\n", + " \n", + " # NN computing method\n", + " def feedforward():\n", + " pass\n", + " \n", + " # NN trainning method \n", + " def backpropagation():\n", + " pass" + ] + }, + { + "cell_type": "markdown", + "id": "9253fc86", + "metadata": {}, + "source": [ + "## Initialization or creation Method\n", + "\n", + "Let’s begin with the initialization. We know we need to set the number of input, hidden and output layer nodes. That defines the shape and size of the neural network. Thus, we’ll let them be set when a new neural network object is created by using the class' parameters. That way we retain the choice to create new neural networks of different sizes with simple methods.\n", + "\n", + "A good programmers, computer scientists and mathematicians, try to create more general code rather than specific code. It is a good habit, because it forces us to think about solving problems in a deeper and more general way. This means that our code can be used in more general scenarios.\n", + "\n", + "Then, ket us see how our code should look like:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "b4431606", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "class NeuralNetwork:\n", + " # init method\n", + " def __init__(self, inputN,hiddenN, outputN, lr):\n", + " # creates a NN with three layers (input, hidden, output)\n", + " # inputN - Number of input nodes\n", + " # hiddenN - Number of hidden nodes\n", + " self.inN=inputN\n", + " self.hiN=hiddenN\n", + " self.outN=outputN\n", + " self.lr=lr\n", + " \n", + " #weight W11 W21 W31\n", + " # W12 W22 W32\n", + " # .....\n", + " self.wih=np.random.rand(self.hiN, self.inN)\n", + " self.who=np.random.rand(self.outN,self.hiN)\n", + " pass\n", + " \n", + " # NN computing method\n", + " def feedforward():\n", + " pass\n", + " \n", + " # NN trainning method \n", + " def backpropagation():\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "d6eb9df0", + "metadata": {}, + "outputs": [], + "source": [ + "myNN=NeuralNetwork(3,3,3,0.1)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "b874c4df", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.86760733, 0.61494357, 0.16001254],\n", + " [0.86192173, 0.71746821, 0.90211204],\n", + " [0.44345426, 0.66751851, 0.33738905]])" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "myNN.wih" + ] + }, + { + "cell_type": "markdown", + "id": "4975a68b", + "metadata": {}, + "source": [ + "At this point were are only creating an object, but the myNN instance can't do any useful yet. Also, this is a good technique to start coding somethig, by keeping it small at the begining (make commits), and then grow the methods.\n", + "\n", + "Next, we should add more code to allow our NN class finish its initialization by creating the weight matrixes." + ] + }, + { + "cell_type": "markdown", + "id": "544d454f", + "metadata": {}, + "source": [ + "## Feedfordward method and weights initialization\n", + "\n", + "So the next step is to create the network of nodes and links. The most important part of the network is the link weights. They’re used to calculate the signal being fed forward, the error as it’s propagated backwards, and it is the link weights themselves that are refined in an attempt to to improve the network.\n", + "\n", + "For the basic NN, the weight matrix consist of:\n", + "\n", + "- A matrix that links the input and hidden layers, $Wih$, of size hidden nodes by input nodes ($hn×in$)\n", + "- and another matrix for the links between the hidden and output layers, $Who$, of size $on×hn$ (output nodes by hidden nodes)\n", + "\n", + "$$X_h=W_{ih}I$$\n", + "$$O_h=\\sigma{X_h}$$" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "id": "ce35cb31", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "\n", + "class NeuralNetwork:\n", + " # init method\n", + " def __init__(self, inputN,hiddenN, outputN, lr):\n", + " # creates a NN with three layers (input, hidden, output)\n", + " # inputN - Number of input nodes\n", + " # hiddenN - Number of hidden nodes\n", + " self.inN=inputN\n", + " self.hiN=hiddenN\n", + " self.outN=outputN\n", + " self.lr=lr\n", + " \n", + " #weight W11 W21 W31\n", + " # W12 W22 W32\n", + " # .....\n", + " np.random.seed(42) \n", + " self.wih=np.random.rand(self.hiN, self.inN)\n", + " self.who=np.random.rand(self.outN,self.hiN)\n", + " pass\n", + " \n", + " # NN computing method\n", + " def feedforward(self, inputList):\n", + " # computing hidden output\n", + " inputs = np.array(inputList, ndmin=2).T\n", + " self.Xh = np.dot(self.wih, inputs)\n", + " self.af = lambda x:1/(1+np.exp(-x))\n", + " self.Oh = self.af(self.Xh)\n", + " \n", + " # computing output \n", + " self.Xo = np.dot(self.who, self.Oh)\n", + " self.Oo = self.af(self.Xo)\n", + " return self.Oo\n", + " \n", + " # NN trainning method \n", + " def backpropagation():\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "id": "c267a481", + "metadata": {}, + "outputs": [], + "source": [ + "myNN=NeuralNetwork(3,5,3,0.3)" + ] + }, + { + "cell_type": "markdown", + "id": "6c07d6dc", + "metadata": {}, + "source": [ + "At this point we can review the variables or class attributes by calling them:" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "id": "eff1bde8", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.37454012, 0.95071431, 0.73199394],\n", + " [0.59865848, 0.15601864, 0.15599452],\n", + " [0.05808361, 0.86617615, 0.60111501],\n", + " [0.70807258, 0.02058449, 0.96990985],\n", + " [0.83244264, 0.21233911, 0.18182497]])" + ] + }, + "execution_count": 89, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "myNN.wih" + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "id": "159d06d2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.72922423],\n", + " [0.74638741],\n", + " [0.77466214]])" + ] + }, + "execution_count": 90, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "myNN.feedforward([0.3, 0.2, 0.1])" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "id": "379439b8", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.59283661],\n", + " [0.55635965],\n", + " [0.56236646],\n", + " [0.57774658],\n", + " [0.57697877]])" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "myNN.Oh" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "id": "4c351ffd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.37570429],\n", + " [0.22640073],\n", + " [0.25077181],\n", + " [0.31352966],\n", + " [0.31038311]])" + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "myNN.Xh" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "id": "e95a288d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([0.72644667, 0.6712605 , 0.63947874])" + ] + }, + "execution_count": 77, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "myNN.Oo" + ] + }, + { + "cell_type": "markdown", + "id": "15769565", + "metadata": {}, + "source": [ + "## The backpropagation and trainning method\n", + "\n", + "$$ \\frac{\\partial E}{\\partial w_{jk}}= -e_j\\cdot \\sigma\\left(\\sum_i w_{ij} o_i\\right) \\left(1-\\sigma\\left(\\sum_i w_{ij} o_i\\right) \\right) o_i $$" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "3006bfec", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "\n", + "class NeuralNetwork:\n", + " # init method\n", + " def __init__(self, inputN,hiddenN, outputN, lr):\n", + " # creates a NN with three layers (input, hidden, output)\n", + " # inputN - Number of input nodes\n", + " # hiddenN - Number of hidden nodes\n", + " self.inN=inputN\n", + " self.hiN=hiddenN\n", + " self.outN=outputN\n", + " self.lr=lr\n", + " \n", + " #weight W11 W21 W31\n", + " # W12 W22 W32\n", + " # .....\n", + " np.random.seed(40) \n", + " self.wih=np.random.rand(self.hiN, self.inN)-0.5\n", + " self.who=np.random.rand(self.outN,self.hiN)-0.5\n", + " pass\n", + " \n", + " # NN computing method\n", + " def feedforward(self, inputList):\n", + " # computing hidden output\n", + " inputs = np.array(inputList, ndmin=2).T\n", + " self.Xh = np.dot(self.wih, inputs)\n", + " self.af = lambda x:1/(1+np.exp(-x))\n", + " self.Oh = self.af(self.Xh)\n", + " \n", + " # computing output \n", + " self.Xo = np.dot(self.who, self.Oh)\n", + " self.Oo = self.af(self.Xo)\n", + " return self.Oo\n", + " \n", + " # NN trainning method \n", + " def backpropagation(self, inputList, targetList):\n", + " # data\n", + " lr = self.lr \n", + " inputs = np.array(inputList, ndmin=2).T\n", + " target = np.array(targetList, ndmin=2).T\n", + " \n", + " #computting hidden layer\n", + " Xh = np.dot(self.wih, inputs)\n", + " af = lambda x:1/(1+np.exp(-x))\n", + " Oh = af(Xh)\n", + " \n", + " # computing output \n", + " Xo = np.dot(self.who, Oh)\n", + " Oo = af(Xo)\n", + " \n", + " # Output error\n", + " oe = target-Oo\n", + " # E propagation\n", + " hiddenE = np.dot(self.who.T, oe)\n", + " \n", + " # updating weights\n", + " self.who+=lr*np.dot(oe*Oo*(1-Oo), Oh.T) \n", + " self.wih+=lr*np.dot(hiddenE*Oh*(1-Oh), inputs.T) \n", + " return self.wih, self.who" + ] + }, + { + "cell_type": "markdown", + "id": "05883c85", + "metadata": {}, + "source": [ + "## Exam" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "a97b0ca8", + "metadata": {}, + "outputs": [], + "source": [ + "NN3 = NeuralNetwork(3,3,3,0.15)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "0a101372", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[-0.09231297, -0.44463396, 0.28853488],\n", + " [-0.21269482, -0.04964941, -0.19608769],\n", + " [ 0.02639952, 0.12381221, 0.27677546]])" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "NN3.wih" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "8c4ed22a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 0.18624165, 0.48093886, 0.10081609],\n", + " [ 0.31396852, 0.20864515, -0.47246532],\n", + " [ 0.40426722, -0.05009515, -0.38107535]])" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "NN3.who" + ] + }, + { + "cell_type": "markdown", + "id": "1b1d8aa2", + "metadata": {}, + "source": [ + "## First Feed" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "a74e4922", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.58611654],\n", + " [0.48786288],\n", + " [0.4846667 ]])" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "NN3.feedforward([0.43, 0.88, 0.95])" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "d55ae872", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([[-0.09474099, -0.44960292, 0.28317066],\n", + " [-0.21423683, -0.05280516, -0.19949447],\n", + " [ 0.02659345, 0.12420909, 0.2772039 ]]),\n", + " array([[ 0.18060506, 0.47579807, 0.09354318],\n", + " [ 0.3176326 , 0.21198694, -0.46773754],\n", + " [ 0.3976255 , -0.05615266, -0.38964518]]))" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "NN3.backpropagation([0.43, 0.88, 0.95], [0.25, 0.7, 0.1])" + ] + }, + { + "cell_type": "markdown", + "id": "86153af2", + "metadata": {}, + "source": [ + "## Second feed" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "id": "6b7af517", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.4262625 ],\n", + " [0.50988177],\n", + " [0.52984418]])" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "NN3.feedforward([0.47, 0.07, 0.64])" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "388f333c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([[ 0.34418188, 0.05427654, -0.04100328],\n", + " [-0.14923924, 0.08653238, 0.03279852],\n", + " [ 0.32666948, -0.23622231, -0.02194774],\n", + " [-0.15480446, -0.36651948, -0.24284465]]),\n", + " array([[-0.44498126, -0.09860092, -0.12175549, 0.0634736 ],\n", + " [ 0.39189539, -0.33801846, -0.09787605, 0.14729404],\n", + " [ 0.04218888, 0.0429173 , -0.00094672, 0.08642189]]))" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "NN3.backpropagation([0.47, 0.07, 0.64], [0.17, 0.67, 0.14])" + ] + }, + { + "cell_type": "markdown", + "id": "c146df50", + "metadata": {}, + "source": [ + "## Third feed" + ] + }, + { + "cell_type": "markdown", + "id": "a2510fdf", + "metadata": {}, + "source": [ + "## Fourth feed" + ] + }, + { + "cell_type": "markdown", + "id": "2599e87a", + "metadata": {}, + "source": [ + "## Fifth feed" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8afe16a9", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b46b2eff", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6401ecc0", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "9b35dffb", + "metadata": {}, + "source": [ + "# MNIST Dataset\n", + "\n", + "Reading the complete file" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "b430564a", + "metadata": {}, + "outputs": [], + "source": [ + "data_file= open(\"mnist_train.csv\", 'r')\n", + "data_list= data_file.readlines()\n", + "data_file.close()" + ] + }, + { + "cell_type": "markdown", + "id": "dcacef2d", + "metadata": {}, + "source": [ + "## Interpreting one intrance" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "b7e043f7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAGdCAYAAABU0qcqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAam0lEQVR4nO3dfUyV9/3/8dfxhuMdHIcIByY61FZdVcycMmL1awdDWea8+0Nrl2hnNDpsqs61cWu1uiVsNukaDdMs2bRN6s1MqqZmM7NYMN3QRapxpi0Tw6oOwdUNDmJFI5/fH8az31GsXngObw4+H8mVyDnXh+vda1d47vIcDz7nnBMAAB2sm/UAAIDHEwECAJggQAAAEwQIAGCCAAEATBAgAIAJAgQAMEGAAAAmelgPcLfW1lbV1tYqMTFRPp/PehwAg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G369OnRmhcA0EV4DlBzc7Oys7NVUlJy332mT5+uS5cuhbddu3Y90pAAgK7H8yu1hYWFKiws/NJ9/H6/gsFgu4cCAHR9MXkNqKysTKmpqRoxYoSWL1+uK1eu3HfflpYWhUKhiA0A0PVFPUDTp0/X22+/rdLSUv3qV79SeXm5CgsL7/v77IuLixUIBMJbe97KCQCIP1H/d0Dz588P/3nMmDEaO3ashg0bprKyMuXl5d2z/9q1a7V69erw16FQiAgBwGMg5m/DHjp0qFJSUlRdXd3m836/X0lJSREbAKDri3mALl68qCtXrig9PT3WhwIAxBHPfwV39erViLuZmpoanTp1SsnJyUpOTtaGDRs0d+5cBYNBnTt3Ti+99JKGDx+uadOmRXVwAEB88xygEydO6Jlnngl/fef1m4ULF2rr1q06ffq03nrrLTU0NCgjI0MFBQX6+c9/Lr/fH72pAQBxz+fa80mPMRQKhRQIBNTY2NilXg966623PK8pKyuL/iBxaMGCBZ7XDB8+vF3HysrKate6ruaPf/yj5zXf+973PK8ZOXKk5zUff/yx5zXoWA/7c5zPggMAmCBAAAATBAgAYIIAAQBMECAAgAkCBAAwQYAAACYIEADABAECAJggQAAAEwQIAGCCAAEATBAgAICJqP9KbrRt4cKFHbIGiIaDBw92yHF++MMfdshx0DlxBwQAMEGAAAAmCBAAwAQBAgCYIEAAABMECABgggABAEwQIACACQIEADBBgAAAJggQAMAEAQIAmODDSAGYmTNnjvUIMMQdEADABAECAJggQAAAEwQIAGCCAAEATBAgAIAJAgQAMEGAAAAmCBAAwAQBAgCYIEAAABMECABgggABAEwQIACACQIEADBBgAAAJggQAMAEAQIAmCBAAAATBAgAYIIAAQBMECAAgAkCBAAwQYAAACYIEADARA/rAQB0Dc45z2s+++wzz2uGDh3qeQ06J+6AAAAmCBAAwISnABUXF2vChAlKTExUamqqZs2apaqqqoh9rl+/rqKiIg0YMED9+vXT3LlzVV9fH9WhAQDxz1OAysvLVVRUpGPHjunw4cO6efOmCgoK1NzcHN5n1apVeu+997R3716Vl5ertrZWc+bMif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GI0dO1bDhg1TWVmZ8vLyDCeLjaKiIp05c+axeB30y9zvPCxdujT85zFjxig9PV15eXk6d+6chg0b1tFjtqnT/xVcSkqKunfvfs+7WOrr6xUMBo2m6hz69++vJ598UtXV1dajmLlzDXB93Gvo0KFKSUnpktfHihUrdPDgQX3wwQcRv74lGAzqxo0bamhoiNi/q14P9zsPbcnJyZGkTnU9dPoAJSQkaPz48SotLQ0/1traqtLSUuXm5hpOZu/q1as6d+6c0tPTrUcxk5WVpWAwGHF9hEIhHT9+/LG/Pi5evKgrV650qevDOacVK1Zo3759OnLkiLKysiKeHz9+vHr27BlxPVRVVen8+fNd6np40Hloy6lTpySpc10P1u+CeBi7d+92fr/f7dixw3388cdu6dKlrn///q6urs56tA714x//2JWVlbmamhr3l7/8xeXn57uUlBR3+fJl69FiqqmpyZ08edKdPHnSSXJvvPGGO3nypPvss8+cc8798pe/dP3793cHDhxwp0+fdjNnznRZWVnuiy++MJ48ur7sPDQ1Nbk1a9a4iooKV1NT495//333jW98wz3xxBPu+vXr1qNHzfLly10gEHBlZWXu0qVL4e3atWvhfZYtW+YGDx7sjhw54k6cOOFyc3Ndbm6u4dTR96DzUF1d7TZu3OhOnDjhampq3IEDB9zQoUPdlClTjCePFBcBcs65LVu2uMGDB7uEhAQ3ceJEd+zYMeuROty8efNcenq6S0hIcF/96lfdvHnzXHV1tfVYMffBBx84SfdsCxcudM7dfiv2q6++6tLS0pzf73d5eXmuqqrKdugY+LLzcO3aNVdQUOAGDhzoevbs6YYMGeKWLFnS5f5PWlv//ZLc9u3bw/t88cUX7kc/+pH7yle+4vr06eNmz57tLl26ZDd0DDzoPJw/f95NmTLFJScnO7/f74YPH+5+8pOfuMbGRtvB78KvYwAAmOj0rwEBALomAgQAMEGAAAAmCBAAwAQBAgCYIEAAABMECABgggABAEwQIACACQIEADBBgAAAJggQAMDE/wMXNIyPwE63lgAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "all_values= data_list[2].split(',')\n", + "image_array= np.asfarray(all_values[1:]).reshape((28,28))\n", + "plt.imshow(image_array, cmap='Greys', interpolation='None')" + ] + }, + { + "cell_type": "markdown", + "id": "5011b407", + "metadata": {}, + "source": [ + "## What the NN sees?" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "1f920b2d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAigAAAGdCAYAAAA44ojeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3hUlEQVR4nO3de3TU9Z3/8dfMIAGFJHJLSAdGMKlovdTlEqO1UswxKtJa2T3VpRraqUnXsCtqrdJubV3b0tOes23tcdFICj2nXqp7hCpVuxRGrDZyq1SwFRNkSr6VgJUlAVoCZD6/P/hlNpPrTDIz38s8H+d8z0nme5nP5/ud+X7f87n6jDFGAAAADuK3OwEAAAA9EaAAAADHIUABAACOQ4ACAAAchwAFAAA4DgEKAABwHAIUAADgOAQoAADAcUbYnYChiMViev/99zV27Fj5fD67kwMAAJJgjNGRI0dUUlIiv3/gMhJXBijvv/++pkyZYncyAADAELS0tCgYDA64jSsDlLFjx0o6ncH8/HybUwMAAJLR3t6uKVOmxJ/jA3FlgNJVrZOfn0+AAgCAyyTTPINGsgAAwHEIUAAAgOMQoAAAAMchQAEAAI5DgAIAAByHAAUAADgOAQoAAHAcAhQAAOA4BCgAAMBxCFAAAIDjEKAAAIbEsixFIhFZlmV3UobMC3nwKgIUAEDKGhoaFAqFNG/ePIVCITU0NNidpJR5IQ9e5jPGGLsTkar29nYVFBSora2NyQJhK8uy1NTUpLKy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bN5rXXXjNlZWWO6ub3L//yL6agoMC88sorCd39/va3v8W3+fKXv2ymTp1qNm7caLZt22YqKipMRUVFfH1XV79rrrnG7Nixw7z88stm4sSJjunqd//995tNmzaZvXv3mrfeesvcf//9xufzmf/5n/8xxrg/fwPp3ovHGG/k9Z577jGvvPKK2bt3r3n99ddNZWWlmTBhgjl48KAxxht53LJlixkxYoT5zne+Y5qamswTTzxhzjzzTPPzn/88vo0X7j/GnO7hOXXqVHPffff1WueFa1ldXW0+8pGPxLsZP/fcc2bChAnmq1/9anybbF1LApRufvKTn5ipU6eakSNHmjlz5pg33njD7iSlJBKJGEm9lurqamPM6e5h3/jGN0xRUZHJy8szV199tdm9e3fCMT788ENzyy23mDFjxpj8/HzzhS98wRw5csSG3PStr/xJMqtWrYpv8/e//93ccccd5uyzzzZnnnmm+exnP2v279+fcJxoNGquu+46M3r0aDNhwgRzzz33mJMnT2Y5N3374he/aEKhkBk5cqSZOHGiufrqq+PBiTHuz99AegYoXsjr5z73OTN58mQzcuRI85GPfMR87nOfSxgfxAt5NMaYF154wVx44YUmLy/PzJgxw9TX1yes98L9xxhjfv3rXxtJvdJujDeuZXt7u7nzzjvN1KlTzahRo8z06dPN17/+9YRu0Nm6lj5jug0PBwAA4AC0QQEAAI5DgAIAAByHAAUAADgOAQoAAHAcAhQAAOA4BCgAAMBxCFAAAIDjEKAAAADHIUABAACOQ4ACAAAchwAFAAA4DgEKAABwnP8HFXIc7vtDGDUAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plt.plot(np.asfarray(all_values[1:]), '.k')" + ] + }, + { + "cell_type": "markdown", + "id": "7e585758", + "metadata": {}, + "source": [ + "## Trainning a NN for MNIST dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "598dc3c4", + "metadata": {}, + "outputs": [], + "source": [ + "# number of input, hidden and output nodes\n", + "input_nodes = 784\n", + "hidden_nodes = 200\n", + "output_nodes = 10\n", + "\n", + "# learning rate\n", + "learning_rate = 0.1\n", + "\n", + "# create instance of neural network\n", + "nn1 = NeuralNetwork(input_nodes,hidden_nodes,output_nodes, learning_rate)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "b68b3583", + "metadata": {}, + "outputs": [], + "source": [ + "# epochs is the number of times the training data set is used for training\n", + "epochs = 1\n", + "\n", + "for e in range(epochs):\n", + " # go through all records in the training data set\n", + " for record in data_list:\n", + " # split the record by the ',' commas\n", + " all_values = record.split(',')\n", + " # scale and shift the inputs\n", + " inputs = (np.asfarray(all_values[1:]) / 255.0 * 0.99) + 0.01\n", + " # create the target output values (all 0.01, except the desired label which is 0.99)\n", + " targets = np.zeros(output_nodes) + 0.01\n", + " # all_values[0] is the target label for this record\n", + " targets[int(all_values[0])] = 0.99\n", + " nn1.backpropagation(inputs, targets)\n", + " pass\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "5af423fd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'4'" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "all_values[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22ed5d0c", + "metadata": {}, + "outputs": [], + "source": [ + "targets" + ] + }, + { + "cell_type": "markdown", + "id": "c26457cb", + "metadata": {}, + "source": [ + "## Testing the trinning NN" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "9df152e5", + "metadata": {}, + "outputs": [], + "source": [ + "# load the mnist test data CSV file into a list\n", + "test_data_file = open(\"mnist_test.csv\", 'r')\n", + "test_data_list = test_data_file.readlines()\n", + "test_data_file.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "98ec6bf3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAGdC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IACACQIEADBBgAAAJggQAMAEAQIAmCBAAAATBAgAYIIAAQBMECAAgAkCBAAwQYAAACYIEADABAECAJggQAAAEwQIAGCCAAEATBAgAIAJAgQAMEGAAAAmCBAAwAQBAgCYIEAAABMECABgggABAEwQIACACQIEADBBgAAAJggQAMAEAQIAmCBAAAATBAgAYIIAAQBMECAAgAkCBAAwMch6ACAZOjs741p34sQJz2uGDx/uec2f//xnz2sWL17sec2BAwc8r5GkF1980fOahQsXel4zePBgz2vQf3AFBAAwQYAAACYSHqCnnnpKPp8vZhs/fnyiXwYA0Mcl5T2gG2+8Ue+///7/XmQQbzUBAGIlpQyDBg1SMBhMxrcGAPQTSXkPaO/evQqFQhozZozuuece7d+//7z7dnR0KBKJxGwAgP4v4QEqKCjQunXrtGXLFq1evVpNTU26+eab1dbW1u3+FRUVCgQC0S0nJyfRIwEAeqGEB6i0tFR33HGH8vLyVFxcrL/85S86evSo3nzzzW73Ly8vVzgcjm7Nzc2JHgkA0Asl/dMBaWlpuv7669XY2Njt836/X36/P9ljAAB6maT/O6Bjx45p3759ys7OTvZLAQD6kIQH6JFHHlFNTY0++eQT/eMf/9Ds2bM1cOBA3XXXXYl+KQBAH5bwv4I7cOCA7rrrLh05ckQjRozQTTfdpPr6eo0YMSLRLwUA6MMSHqDXX3890d8S8Gz79u1xrbv55ps9r7nnnns8r3n11Vc9r4mHz+eLa91PfvITz2uGDh3qec29997reQ3vGfcf3AsOAGCCAAEATBAgAIAJAgQAMEGAAAAmCBAAwAQBAgCYIEAAABMECABgggABAEwQIACACQIEADCR9B9IB1j45z//2WOv9corr3heE89NQp944gnPa+bNm+d5jSSNGzfO85of//jHnte0tLR4XvP44497XoPeiSsgAIAJAgQAMEGAAAAmCBAAwAQBAgCYIEAAABMECABgggABAEwQIACACQIEADBBgAAAJggQAMAEAQIAmOBu2Oj1mpubPa95+OGHkzBJ4vzpT3/yvKa4uNjzmoEDB3peI0k///nPPa959tlnPa85ePCg5zXoP7gCAgCYIEAAABMECABg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u3Okkueeff97t3LnTffrpp845537zm9+4tLQ0t2nTJrd792532223udzcXHfixAnjyRPrQsehra3NPfLII66urs41NTW5999/333zm9901113nTt58qT16AmzaNEiFwgEXHV1tTt06FB0O378eHSfBx54wI0aNcpt3brVbd++3RUWFrrCwkLDqRPvYsehsbHR/fKXv3Tbt293TU1NbtOmTW7MmDFu2rRpxpPH6hMBcs65VatWuVGjRrkhQ4a4KVOmuPr6euuRetzcuXNddna2GzJkiPvqV7/q5s6d6xobG63HSroPPvjASTpnmzdvnnPuzEexn3zySZeVleX8fr+bMWOGa2hosB06CS50HI4fP+5mzpzpRowY4QYPHuxGjx7tFixY0O/+T1p3//2S3Nq1a6P7nDhxwj344IPuK1/5irvqqqvc7Nmz3aFDh+yGToKLHYf9+/e7adOmufT0dOf3+924cePcz372MxcOh20H/xJ+HAMAwESvfw8IANA/ESAAgAkCBAAwQYAAACYIEADABAECAJggQAAAEwQIAGCCAAEATBAgAIAJAgQAMEGAAAAm/g+bJtPV5uFCTQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "all_values= test_data_list[55].split(',')\n", + "image_array= np.asfarray(all_values[1:]).reshape((28,28))\n", + "plt.imshow(image_array, cmap='Greys',interpolation='None')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "b1f6858d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[1.],\n", + " [1.],\n", + " [1.],\n", + " [1.],\n", + " [1.],\n", + " [1.],\n", + " [1.],\n", + " [1.],\n", + " [1.],\n", + " [1.]])" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nn1.feedforward((np.asfarray(all_values[1:])/255.0*0.99)+0.01)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "4eb2a993", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.18726904, 0.08814464, 0.76482022, ..., 0.70586941, 0.1568063 ,\n", + " 0.4999693 ],\n", + " [0.53312775, 0.84159698, 0.45797607, ..., 0.71989791, 0.67931778,\n", + " 0.83039971],\n", + " [0.99283059, 0.35872355, 0.15924308, ..., 0.62648659, 0.97066054,\n", + " 0.03276188],\n", + " ...,\n", + " [0.6879452 , 0.26462095, 0.17300758, ..., 0.02829032, 0.16182483,\n", + " 0.45969922],\n", + " [0.17684306, 0.41909022, 0.21317277, ..., 0.34570399, 0.96639186,\n", + " 0.71681652],\n", + " [0.45144587, 0.8926533 , 0.41438135, ..., 0.75578523, 0.88247098,\n", + " 0.8760342 ]])" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nn1.who" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "017ed6db", + "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.8.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}