{"id":4943,"date":"2024-06-17T08:17:16","date_gmt":"2024-06-17T06:17:16","guid":{"rendered":"https:\/\/neogeo.fr\/my-first-neural-network\/"},"modified":"2026-10-23T16:26:11","modified_gmt":"2026-10-23T14:26:11","slug":"my-first-neural-network","status":"publish","type":"post","link":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/","title":{"rendered":"My First Neural Network"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To better understand the article on <a href=\"https:\/\/neogeo.fr\/en\/discover-neural-networks-the-brain-of-ai\/\">neural networks<\/a>, this week we invite you to code a small neural network to gain a clearer understanding of what weights, <em>feed forward<\/em>, and other concepts introduced in the previous article are.<\/p>\n\n<p class=\"wp-block-paragraph\">We will create a single-neuron neural network and attempt to make it predict data points located on a straight line. This exercise is trivial and can be solved without using AI, but let&#8217;s remain humble to start. <\/p>\n\n<h2 class=\"wp-block-heading\">Project Setup<\/h2>\n\n<p class=\"wp-block-paragraph\">Let&#8217;s use <strong>Jupyter<\/strong>, which remains the tool of choice for testing and developing AI.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\"># On cr\u00e9e un environnement virtuelle python, et on l&#039;active\npython3 -m venv test_ia\ncd test_ia\n. bin\/activate\n\n# On installe jupyter et on le lance\npip install jupyter\njupyter notebook<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">This last command will open Jupyter in your browser.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"642\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter.png\" alt=\"\" class=\"wp-image-1299\" style=\"width:446px;height:auto\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter.png 957w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter-300x201.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter-768x515.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/figure>\n<\/div>\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n<p class=\"wp-block-paragraph\">You can go to \u201cFile\u201d -&gt; \u201cNew\u201d -&gt; \u201cNotebook\u201d to create a new file and copy\/test our program.<\/p>\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"642\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter_new_notebook-1.png\" alt=\"\" class=\"wp-image-1301\" style=\"width:446px;height:auto\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter_new_notebook-1.png 957w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter_new_notebook-1-300x201.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Jupyter_new_notebook-1-768x515.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">If the &#8220;Notebook&#8221; option is not available, replace &#8220;tree&#8221; with &#8220;lab&#8221; in your URL. The interface will then be slightly different, but you can create a new Notebook from &#8220;File&#8221; -&gt; &#8220;New&#8221; -&gt; &#8220;Notebook&#8221;. <\/p>\n\n<p class=\"wp-block-paragraph\"><strong>What do we need?<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\"><strong>Numpy<\/strong> is a Python library optimized for list management.<\/p>\n\n<p class=\"wp-block-paragraph\">NB: There is an exclamation mark at the beginning of the line, which means the command will be run in the shell. Here, it will install dependencies in our virtual environment. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">!pip install numpy\nimport numpy as np\n\nRequirement already satisfied: numpy in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (1.26.4)<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\"><strong>Pandas<\/strong>, the star Python library for data science, itself based on Numpy.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">!pip install pandas\nimport pandas as pd\nRequirement already satisfied: pandas in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (2.2.2)\nRequirement already satisfied: numpy&gt;=1.23.2 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from pandas) (1.26.4)\nRequirement already satisfied: python-dateutil&gt;=2.8.2 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from pandas) (2.9.0.post0)\nRequirement already satisfied: pytz&gt;=2020.1 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from pandas) (2024.1)\nRequirement already satisfied: tzdata&gt;=2022.7 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from pandas) (2024.1)\nRequirement already satisfied: six&gt;=1.5 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from python-dateutil&gt;=2.8.2-&gt;pandas) (1.16.0)\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\"><strong>Pytorch<\/strong>, one of the main Python libraries for building neural networks. Here we are only installing the CPU version; the base version works with CUDA, Nvidia&#8217;s scientific computing library, but it takes up a lot of disk space, so let&#8217;s be frugal. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">!pip3 install torch --index-url https:\/\/download.pytorch.org\/whl\/cpu\nimport torch\nimport torch.nn.functional as F\nLooking in indexes: https:\/\/download.pytorch.org\/whl\/cpu\nCollecting torch\n  Downloading https:\/\/download.pytorch.org\/whl\/cpu\/torch-2.3.1%2Bcpu-cp311-cp311-linux_x86_64.whl (190.4 MB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m190.4\/190.4 MB&#091;0m &#091;31m26.4 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0mm eta &#091;36m0:00:01&#091;0m&#091;36m0:00:01&#091;0m\n&#091;?25hCollecting filelock\n  Downloading https:\/\/download.pytorch.org\/whl\/filelock-3.13.1-py3-none-any.whl (11 kB)\nRequirement already satisfied: typing-extensions&gt;=4.8.0 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from torch) (4.12.2)\nCollecting sympy\n  Downloading https:\/\/download.pytorch.org\/whl\/sympy-1.12-py3-none-any.whl (5.7 MB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m5.7\/5.7 MB&#091;0m &#091;31m57.2 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0m MB\/s&#091;0m eta &#091;36m0:00:01&#091;0m\n&#091;?25hCollecting networkx\n  Downloading https:\/\/download.pytorch.org\/whl\/networkx-3.2.1-py3-none-any.whl (1.6 MB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m1.6\/1.6 MB&#091;0m &#091;31m58.6 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0m\n&#091;?25hRequirement already satisfied: jinja2 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from torch) (3.1.4)\nCollecting fsspec\n  Downloading https:\/\/download.pytorch.org\/whl\/fsspec-2024.2.0-py3-none-any.whl (170 kB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m170.9\/170.9 kB&#091;0m &#091;31m18.5 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0m\n&#091;?25hRequirement already satisfied: MarkupSafe&gt;=2.0 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from jinja2-&gt;torch) (2.1.5)\nCollecting mpmath&gt;=0.19\n  Downloading https:\/\/download.pytorch.org\/whl\/mpmath-1.3.0-py3-none-any.whl (536 kB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m536.2\/536.2 kB&#091;0m &#091;31m42.9 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0m\n&#091;?25hInstalling collected packages: mpmath, sympy, networkx, fsspec, filelock, torch\nSuccessfully installed filelock-3.13.1 fsspec-2024.2.0 mpmath-1.3.0 networkx-3.2.1 sympy-1.12 torch-2.3.1+cpu\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\"><strong>Matplotlib<\/strong>, for creating nice graphs.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">!pip install matplotlib\nfrom matplotlib import pyplot as plt\n%matplotlib inline\nCollecting matplotlib\n  Downloading matplotlib-3.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m8.3\/8.3 MB&#091;0m &#091;31m44.0 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0mm eta &#091;36m0:00:01&#091;0m0:01&#091;0m:01&#091;0m\n&#091;?25hCollecting contourpy&gt;=1.0.1\n  Using cached contourpy-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (306 kB)\nCollecting cycler&gt;=0.10\n  Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)\nCollecting fonttools&gt;=4.22.0\n  Downloading fonttools-4.53.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB)\n&#091;2K     &#091;38;2;114;156;31m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501&#091;0m &#091;32m4.9\/4.9 MB&#091;0m &#091;31m57.3 MB\/s&#091;0m eta &#091;36m0:00:00&#091;0m31m72.7 MB\/s&#091;0m eta &#091;36m0:00:01&#091;0m\n&#091;?25hCollecting kiwisolver&gt;=1.3.1\n  Using cached kiwisolver-1.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB)\nRequirement already satisfied: numpy&gt;=1.23 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from matplotlib) (1.26.4)\nRequirement already satisfied: packaging&gt;=20.0 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from matplotlib) (24.1)\nCollecting pillow&gt;=8\n  Using cached pillow-10.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (4.5 MB)\nCollecting pyparsing&gt;=2.3.1\n  Using cached pyparsing-3.1.2-py3-none-any.whl (103 kB)\nRequirement already satisfied: python-dateutil&gt;=2.7 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from matplotlib) (2.9.0.post0)\nRequirement already satisfied: six&gt;=1.5 in \/home\/seba\/.local\/share\/virtualenvs\/blog-simple-neural-network-F0Tscko_\/lib\/python3.11\/site-packages (from python-dateutil&gt;=2.7-&gt;matplotlib) (1.16.0)\nInstalling collected packages: pyparsing, pillow, kiwisolver, fonttools, cycler, contourpy, matplotlib\nSuccessfully installed contourpy-1.2.1 cycler-0.12.1 fonttools-4.53.0 kiwisolver-1.4.5 matplotlib-3.9.0 pillow-10.3.0 pyparsing-3.1.2\nfrom random import randint, seed\n<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Creating a Simple Dataset<\/h2>\n\n<p class=\"wp-block-paragraph\">For demonstration purposes, we will create a perfectly linear dataset <em>f(x) = 2*x<\/em>.<\/p>\n\n<p class=\"wp-block-paragraph\">We can easily verify that the network&#8217;s predictions lie on this line.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">data = pd.DataFrame(columns=&#091;&quot;x&quot;, &quot;y&quot;],\n                    data=&#091;(x, x*2) for x in range(10)],\n                   )\ndata&#091;&quot;x&quot;] = data&#091;&quot;x&quot;].astype(float)\ndata&#091;&quot;y&quot;] = data&#091;&quot;y&quot;].astype(float)\n\ndata.plot.scatter(x=&quot;x&quot;, y=&quot;y&quot;)\n&lt;Axes: xlabel=&#039;x&#039;, ylabel=&#039;y&#039;&gt;\n<\/code><\/pre>\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"432\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_12_1.png\" alt=\"\" class=\"wp-image-1302\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_12_1.png 576w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_12_1-300x225.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">data<\/code><\/pre>\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"101\" height=\"336\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Tableau-donnees.png\" alt=\"\" class=\"wp-image-1303\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Tableau-donnees.png 101w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Tableau-donnees-90x300.png 90w\" sizes=\"auto, (max-width: 101px) 100vw, 101px\" \/><\/figure>\n\n<h2 class=\"wp-block-heading\">Getting Started<\/h2>\n\n<p class=\"wp-block-paragraph\">Let&#8217;s prepare some variables for the project. We also initialize model M; if you want to test code evolutions, rerun this cell to reset the model. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\"># On fait en sorte que pytorch tire toujours la m\u00eame suite de nombres al\u00e9atoires\n# Comme \u00e7a vous devriez avoir les m\u00eames r\u00e9sultats que moi.\ntorch.manual_seed(1337)\nseed(1337)\n\n# Je cr\u00e9e mon r\u00e9seau d\u2019un neurone avec une valeur al\u00e9atoire\nM = torch.randn((1,1))\n\n# On active le calcul du gradient dans le r\u00e9seau\nM.requires_grad = True\nprint(M)\n\n# On garde une liste de pertes pour plus tard\nlosses = list()\ntensor(&#091;&#091;-2.0260]], requires_grad=True)\n<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">General Algorithm<\/h2>\n\n<p class=\"wp-block-paragraph\">For our network to learn from data, we need a <em>feed forward<\/em> phase and a <em>back propagation<\/em> phase.<\/p>\n\n<p class=\"wp-block-paragraph\">What does that involve?<\/p>\n\n<p class=\"wp-block-paragraph\">Let&#8217;s take an example from our dataset, the line <em>x=9<\/em> and <em>y=18<\/em>.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\"># on prend un \u00e9chantillon\nix = randint(0, len(data)-1)  # Indice de X\n\nx = data.iloc&#091;ix]&#091;&quot;x&quot;]\ny = data.iloc&#091;ix]&#091;&quot;y&quot;]\nprint(f&quot;{x=},{y=}&quot;)\nx=9.0,y=18.0\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">The <em>feed forward<\/em> phase consists of asking the model what data it predicts for x=9. We use the \u201c@\u201d operator, which multiplies tensors. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">X = torch.tensor(&#091;x])\ny_prevision = M @ X\n---------------------------------------------------------------------------\n\nRuntimeError                              Traceback (most recent call last)\n\nCell In&#091;10], line 2\n      1 X = torch.tensor(&#091;x])\n----&gt; 2 y_prevision = M @ X\n\n\nRuntimeError: expected scalar type Float but found Double\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Ah yes, Numpy internally converts our Float (32-bit) to Double (64-bit). Let&#8217;s convert our tensor to Float in this case. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">X = torch.tensor(&#091;x]).float()\ny_prevision = M @ X\nprint(f&quot;{y_prevision=}&quot;)\ny_prevision=tensor(&#091;-18.2339], grad_fn=&lt;MvBackward0&gt;)\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Our model therefore predicts \u201c-18.2339\u201d, whereas our <em>y<\/em> value is <em>18<\/em>.<\/p>\n\n<p class=\"wp-block-paragraph\">This is normal since we initialized our model with completely random values.<\/p>\n\n<p class=\"wp-block-paragraph\">We therefore need to correct our model, but first we will use a loss function, here <em>l1_loss<\/em>, to see how far off we are.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">Y = torch.Tensor(&#091;y])\nloss = F.l1_loss(y_prevision, Y)\nprint(&quot;loss&quot;, loss.item())\nloss 36.23392868041992\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">We are off by 36 (i.e., 18 &#8211; (-18.23)), which is a lot.<\/p>\n\n<p class=\"wp-block-paragraph\">To correct the model, we will perform the <em>back propagation<\/em> phase (or backward pass).<\/p>\n\n<p class=\"wp-block-paragraph\">We will ask Pytorch to calculate the impact of the model&#8217;s weights on this decision. This is the gradient calculation. This operation, while not very complicated as it involves deriving all performed operations, deserves a separate article and will not be covered here.  <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\"># backward pass\nM.grad = None\nloss.backward()\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Caution: you must always reset the gradient before starting <em>back propagation<\/em>.<\/p>\n\n<p class=\"wp-block-paragraph\">Now that we have a gradient, we will update our model by applying a fraction of this tensor to it.<\/p>\n\n<p class=\"wp-block-paragraph\">Why only a fraction? Here we have a very simple linear function to model. By applying the gradient, we would correct the model immediately. The problem is that, in real life, the situation is never that simple. In reality, data is heterogeneous, and therefore, applying the gradient to one data point improves the result for that point but would yield a very poor gradient for other data points.    <\/p>\n\n<p class=\"wp-block-paragraph\">We will therefore apply a fraction of the gradient and try to find the best compromise. This can be determined using the <em>loss function<\/em>. <\/p>\n\n<p class=\"wp-block-paragraph\">We will therefore apply a modification of 0.1 times the gradient to our model; this 0.1 is called the <em>learning rate<\/em>.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\"># update\nlr = 0.1\nM.data += -lr * M.grad\nprint(f&quot;{M.grad=}, {M.data=}&quot;)\nM.grad=tensor(&#091;&#091;-9.]]), M.data=tensor(&#091;&#091;-1.1260]])\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">We will see how to choose the <em>learning rate<\/em> in another article.<\/p>\n\n<p class=\"wp-block-paragraph\">Let&#8217;s see the result:<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\"># forward pass\ny_prevision = M @ X\nprint(f&quot;{y_prevision=}&quot;)\ny_prevision=tensor(&#091;-10.1339], grad_fn=&lt;MvBackward0&gt;)\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Not bad, we went from -18 to -10. It&#8217;s still very poor, but we&#8217;ve only executed our <em>feed forward<\/em> \/ <em>back propagation<\/em> cycle once. <\/p>\n\n<p class=\"wp-block-paragraph\">Let&#8217;s make sure to call our algorithm multiple times.<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">for i in range(1000):\n    # on prend un \u00e9chantillon\n    ix = randint(0, len(data)-1)\n    \n    x = data.iloc&#091;ix]&#091;&quot;x&quot;]\n    y = data.iloc&#091;ix]&#091;&quot;y&quot;]\n    \n    # forward pass\n    y_prevision = M @ torch.tensor(&#091;x]).float()\n    loss = F.l1_loss(y_prevision, torch.Tensor(&#091;y]))\n\n    # backward pass\n    M.grad = None\n    loss.backward()\n\n    # update\n    lr = 0.01\n    M.data += -lr * M.grad\n\n    # stats\n    losses.append(loss.item())\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Let&#8217;s see what our prediction looks like on a graph. Data points in red, prediction curve in blue. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">ax = data.plot.scatter(x=&quot;x&quot;, y=&quot;y&quot;, color=&quot;red&quot;)\nprevision = pd.DataFrame(np.arange(10), columns=&#091;&quot;x&quot;])\nm = M.detach()\nprevision&#091;&quot;y_prevision&quot;] = prevision&#091;&quot;x&quot;].apply(lambda x: (m @ torch.tensor(&#091;float(x)]))&#091;0].numpy()) #torch.tensor(&#091;4.])\nprevision.plot(y=&quot;y_prevision&quot;, ax=ax, x=&quot;x&quot;)\n&lt;Axes: xlabel=&#039;x&#039;, ylabel=&#039;y&#039;&gt;\n<\/code><\/pre>\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"432\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_33_1.png\" alt=\"\" class=\"wp-image-1304\" style=\"width:427px;height:auto\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_33_1.png 576w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_33_1-300x225.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">What if we go beyond the data range with an X of 2000?<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">m @ torch.tensor(&#091;float(2000)])\ntensor(&#091;4028.0156])\n<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Not bad, we should have 4000, but it&#8217;s already better.<\/p>\n\n<p class=\"wp-block-paragraph\">And compared to our base data?<\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">prevision<\/code><\/pre>\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"136\" height=\"336\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Tableau-previsions-1.png\" alt=\"\" class=\"wp-image-1308\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Tableau-previsions-1.png 136w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/Tableau-previsions-1-121x300.png 121w\" sizes=\"auto, (max-width: 136px) 100vw, 136px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">Okay, what&#8217;s happening? Let&#8217;s look at the evolution of our loss as a function of iterations. <\/p>\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">pd.DataFrame(losses, columns=&#091;&quot;loss&quot;]).plot()\n&lt;Axes: &gt;<\/code><\/pre>\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"413\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_39_1-2.png\" alt=\"\" class=\"wp-image-1309\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_39_1-2.png 543w, https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/output_39_1-2-300x228.png 300w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">We see that the losses are significant for 100 iterations and then stabilize somewhat between 0 and 0.8.<\/p>\n\n<p class=\"wp-block-paragraph\">Can we improve this? Yes, very easily; we will see this together in a future article. <\/p>\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n<p class=\"wp-block-paragraph\">We have learned how to create a model and perform training with the <em>feed forward<\/em> and <em>back propagation<\/em> phases. Then we saw that the <em>learning rate<\/em> and <em>gradient<\/em> allow us to correct the model little by little. By performing a few hundred iterations, we have a good regression model.  <\/p>\n\n<p class=\"wp-block-paragraph\">I hope this brief introduction has made you want to go further.<\/p>\n\n<p class=\"wp-block-paragraph\"><em>Author: S\u00e9bastien Da Rocha<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To better understand the article on neural networks, this week we invite you to code a small neural network to gain a clearer understanding of what weights, feed forward, and other concepts introduced in the previous article are. We will create a single-neuron neural network and attempt to make it predict data points located on &#8230; <a title=\"My First Neural Network\" class=\"read-more\" href=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\" aria-label=\"Read more about My First Neural Network\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":4948,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[],"class_list":["post-4943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Neural Networks in PyTorch: The First Step | NEOGEO<\/title>\n<meta name=\"description\" content=\"Coding a single-neuron network in PyTorch: feed forward, back propagation, and learning rate, step-by-step in Jupyter.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Neural Networks in PyTorch: The First Step | NEOGEO\" \/>\n<meta property=\"og:description\" content=\"Coding a single-neuron network in PyTorch: feed forward, back propagation, and learning rate, step-by-step in Jupyter.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\" \/>\n<meta property=\"og:site_name\" content=\"NEOGEO\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-17T06:17:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-23T14:26:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/20945347-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Philippe DESTR\u00c9\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Philippe DESTR\u00c9\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/\"},\"author\":{\"name\":\"Philippe DESTR\u00c9\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#\\\/schema\\\/person\\\/69685e84302b110f77d59dc8ee6e2d40\"},\"headline\":\"My First Neural Network\",\"datePublished\":\"2024-06-17T06:17:16+00:00\",\"dateModified\":\"2026-10-23T14:26:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/\"},\"wordCount\":881,\"publisher\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/20945347-scaled-1.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/\",\"name\":\"Neural Networks in PyTorch: The First Step | NEOGEO\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/20945347-scaled-1.jpg\",\"datePublished\":\"2024-06-17T06:17:16+00:00\",\"dateModified\":\"2026-10-23T14:26:11+00:00\",\"description\":\"Coding a single-neuron network in PyTorch: feed forward, back propagation, and learning rate, step-by-step in Jupyter.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#primaryimage\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/20945347-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/20945347-scaled-1.jpg\",\"width\":2560,\"height\":1707,\"caption\":\"Brain with digital circuit and programmer with laptop. Machine learning, artificial intelligence, digital brain and artificial thinking process concept. Vector isolated illustration.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/my-first-neural-network\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"My First Neural Network\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/\",\"name\":\"NEOGEO\",\"description\":\"Optimisez,\u00a0valorisez,\\u2028partagez\u00a0vos\u00a0donn\u00e9es\u00a0spatiales\",\"publisher\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#organization\",\"name\":\"NEOGEO\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/NEOGEO-LOGO.svg\",\"contentUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/NEOGEO-LOGO.svg\",\"width\":145,\"height\":42,\"caption\":\"NEOGEO\"},\"image\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#\\\/schema\\\/person\\\/69685e84302b110f77d59dc8ee6e2d40\",\"name\":\"Philippe DESTR\u00c9\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b366889cd846213d38b977f63dd60b6af7e9ed5b067a024a76fe0865155ef9db?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b366889cd846213d38b977f63dd60b6af7e9ed5b067a024a76fe0865155ef9db?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b366889cd846213d38b977f63dd60b6af7e9ed5b067a024a76fe0865155ef9db?s=96&d=mm&r=g\",\"caption\":\"Philippe DESTR\u00c9\"},\"url\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/author\\\/pdestreneogeo\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Neural Networks in PyTorch: The First Step | NEOGEO","description":"Coding a single-neuron network in PyTorch: feed forward, back propagation, and learning rate, step-by-step in Jupyter.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/","og_locale":"en_US","og_type":"article","og_title":"Neural Networks in PyTorch: The First Step | NEOGEO","og_description":"Coding a single-neuron network in PyTorch: feed forward, back propagation, and learning rate, step-by-step in Jupyter.","og_url":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/","og_site_name":"NEOGEO","article_published_time":"2024-06-17T06:17:16+00:00","article_modified_time":"2026-10-23T14:26:11+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/20945347-scaled-1.jpg","type":"image\/jpeg"}],"author":"Philippe DESTR\u00c9","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Philippe DESTR\u00c9","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#article","isPartOf":{"@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/"},"author":{"name":"Philippe DESTR\u00c9","@id":"https:\/\/neogeo.fr\/en\/#\/schema\/person\/69685e84302b110f77d59dc8ee6e2d40"},"headline":"My First Neural Network","datePublished":"2024-06-17T06:17:16+00:00","dateModified":"2026-10-23T14:26:11+00:00","mainEntityOfPage":{"@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/"},"wordCount":881,"publisher":{"@id":"https:\/\/neogeo.fr\/en\/#organization"},"image":{"@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#primaryimage"},"thumbnailUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/20945347-scaled-1.jpg","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/","url":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/","name":"Neural Networks in PyTorch: The First Step | NEOGEO","isPartOf":{"@id":"https:\/\/neogeo.fr\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#primaryimage"},"image":{"@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#primaryimage"},"thumbnailUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/20945347-scaled-1.jpg","datePublished":"2024-06-17T06:17:16+00:00","dateModified":"2026-10-23T14:26:11+00:00","description":"Coding a single-neuron network in PyTorch: feed forward, back propagation, and learning rate, step-by-step in Jupyter.","breadcrumb":{"@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/neogeo.fr\/en\/my-first-neural-network\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#primaryimage","url":"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/20945347-scaled-1.jpg","contentUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2024\/06\/20945347-scaled-1.jpg","width":2560,"height":1707,"caption":"Brain with digital circuit and programmer with laptop. Machine learning, artificial intelligence, digital brain and artificial thinking process concept. Vector isolated illustration."},{"@type":"BreadcrumbList","@id":"https:\/\/neogeo.fr\/en\/my-first-neural-network\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/neogeo.fr\/en\/"},{"@type":"ListItem","position":2,"name":"My First Neural Network"}]},{"@type":"WebSite","@id":"https:\/\/neogeo.fr\/en\/#website","url":"https:\/\/neogeo.fr\/en\/","name":"NEOGEO","description":"Optimisez,\u00a0valorisez,\u2028partagez\u00a0vos\u00a0donn\u00e9es\u00a0spatiales","publisher":{"@id":"https:\/\/neogeo.fr\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/neogeo.fr\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/neogeo.fr\/en\/#organization","name":"NEOGEO","url":"https:\/\/neogeo.fr\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/neogeo.fr\/en\/#\/schema\/logo\/image\/","url":"https:\/\/neogeo.fr\/wp-content\/uploads\/2026\/06\/NEOGEO-LOGO.svg","contentUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2026\/06\/NEOGEO-LOGO.svg","width":145,"height":42,"caption":"NEOGEO"},"image":{"@id":"https:\/\/neogeo.fr\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/neogeo.fr\/en\/#\/schema\/person\/69685e84302b110f77d59dc8ee6e2d40","name":"Philippe DESTR\u00c9","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b366889cd846213d38b977f63dd60b6af7e9ed5b067a024a76fe0865155ef9db?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b366889cd846213d38b977f63dd60b6af7e9ed5b067a024a76fe0865155ef9db?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b366889cd846213d38b977f63dd60b6af7e9ed5b067a024a76fe0865155ef9db?s=96&d=mm&r=g","caption":"Philippe DESTR\u00c9"},"url":"https:\/\/neogeo.fr\/en\/author\/pdestreneogeo\/"}]}},"_links":{"self":[{"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/posts\/4943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/comments?post=4943"}],"version-history":[{"count":1,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/posts\/4943\/revisions"}],"predecessor-version":[{"id":4949,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/posts\/4943\/revisions\/4949"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/media\/4948"}],"wp:attachment":[{"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/media?parent=4943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/categories?post=4943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/tags?post=4943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}