{"id":4865,"date":"2025-04-22T15:39:01","date_gmt":"2025-04-22T13:39:01","guid":{"rendered":"https:\/\/neogeo.fr\/tutorial-effectively-train-my-first-neural-network\/"},"modified":"2026-10-23T16:23:28","modified_gmt":"2026-10-23T14:23:28","slug":"tutorial-effectively-train-my-first-neural-network","status":"publish","type":"post","link":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/","title":{"rendered":"Tutorial: Effectively Train My First Neural Network"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">After learning how to create your first neural network in the article <strong><strong><a href=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\">My First Neural Network<\/a><\/strong><\/strong> and studying the theory of model optimization in the article <strong><a href=\"https:\/\/neogeo.fr\/en\/simple-neural-network-optimization\/\">Simple Neural Network Optimization<\/a><\/strong>, it&#8217;s now time to practice <strong>effectively training<\/strong> a neural network! \ud83d\ude80<\/p>\n\n<p class=\"wp-block-paragraph\">To do this, we will revisit the model creation from the article <a href=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\">My First Neural Network<\/a>. We will perform several training sessions to determine the importance of the <strong>learning rate<\/strong> in model training. If you have any doubts about the concept of learning rate, the article <a href=\"https:\/\/neogeo.fr\/en\/simple-neural-network-optimization\/\">Simple Neural Network Optimization<\/a> is there to guide you.  <\/p>\n\n<h2 class=\"wp-block-heading\"><strong>Notebook Preparation<\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">Great! Let&#8217;s start by performing all the installations and imports we&#8217;ll need for this tutorial. We&#8217;ll once again use <strong>Jupyter<\/strong> for development.  <\/p>\n\n<p class=\"wp-block-paragraph\">Create a Python virtual environment (unnecessary if you already created one for the article <a href=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\">My First Neural Network<\/a>):<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">python3 -m venv test_ia<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Activate the Python virtual environment:<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">cd test_ia\n. bin\/activate<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Install Jupyter and launch it:<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">pip install jupyter\njupyter notebook<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">The last command automatically opens Jupyter in your browser. You then just need to create a <strong>Notebook<\/strong> by going to &#8220;File&#8221; \u2192 &#8220;New&#8221; \u2192 &#8220;Notebook&#8221;. Then copy the following code into the Notebook.  <\/p>\n\n<h2 class=\"wp-block-heading\"><strong>Installations &amp; Imports <sup>*1<\/sup><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\"><sup>*1<\/sup>: This step was also done in the first tutorial described in the article <a href=\"https:\/\/neogeo.fr\/en\/my-first-neural-network\/\">My First Neural Network<\/a>.<\/p>\n\n<p class=\"wp-block-paragraph\">First, we need to install the following libraries:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>PyTorch<\/strong>, one of the main Python libraries for 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. <\/li>\n\n\n\n<li><strong>Pandas<\/strong>, the star Python library for data science, itself based on Numpy (for list management).<\/li>\n\n\n\n<li><strong>Matplotlib<\/strong>, for creating nice graphs.<\/li>\n<\/ul>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">!pip3 install torch --index-url https:\/\/download.pytorch.org\/whl\/cpu\n!pip install pandas\n!pip install matplotlib<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Once the installations are complete, we can proceed to import these libraries or specific elements from them.<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">import torch\nimport torch.nn.functional as F\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom random import randint, seed\n# Nous n&#039;avons pas eu besoin d&#039;installer random car c&#039;est une biblioth\u00e8que standard de Python<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Everything is now in place to start the tutorial well!<\/p>\n\n<h2 class=\"wp-block-heading\"><strong><strong>Creating a Dataset<\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">The first step to training our model is to <strong>create<\/strong> a <strong>dataset<\/strong> suitable for our problem, on which we can train our model.<\/p>\n\n<p class=\"wp-block-paragraph\">This time, we&#8217;ll use the example of a skier at the bottom of a mountain climbing up to its summit.<\/p>\n\n<p class=\"wp-block-paragraph\">Therefore, we need a dataset that represents the slope of this mountain to train our model.<\/p>\n\n<p class=\"wp-block-paragraph\">For this example, we will use a very simple, linear slope with the equation <strong>f(x) = 2x<\/strong>. So, this function, a simplified version from the previous article, is what we will use to create our dataset. <\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">data = pd.DataFrame(columns=[&quot;x&quot;, &quot;y&quot;],\n                    data=[(x, x*2) for x in range(10)],\n                   )\ndata[&quot;x&quot;] = data[&quot;x&quot;].astype(float)\ndata[&quot;y&quot;] = data[&quot;y&quot;].astype(float)\n# On peut visualiser le jeu de donn\u00e9es d&#039;entra\u00eenement ci-dessous\nplt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.scatter(data[&quot;x&quot;], data[&quot;y&quot;], alpha=0.5)\nplt.title(&quot;Jeu de donn\u00e9es d&#039;entra\u00eenement&quot;)\nplt.xlabel(&quot;Position x&quot;)\nplt.ylabel(&quot;Altitude y&quot;)\nplt.grid(True)\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_dataset-1024x236.png\" alt=\"\"\/><\/figure>\n\n<h2 class=\"wp-block-heading\"><strong><strong><strong>Creating Our Model<\/strong><\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">Now that our dataset is ready, we can proceed to create our model.<\/p>\n\n<p class=\"wp-block-paragraph\">We will create a very simple model because our problem is not very complex. Indeed, the slope of our mountain is linear; consequently, our model only needs one layer of neurons. To create it, we will use PyTorch with a fixed seed to ensure reproducible results.  <\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">torch.manual_seed(1337)\nseed(1337)\nM = torch.randn((1,1))\nM.requires_grad = True\nprint(M)<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\"><strong><strong><strong><strong>Training Our Model<\/strong><\/strong><\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">With our model and dataset ready, we can now proceed to train the model.<\/p>\n\n<p class=\"wp-block-paragraph\">To train our model, we still need to define two variables: <strong>epochs<\/strong> and <strong>lr<\/strong>.<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>epochs<\/strong> represents the number of times the model is trained on a data sample<\/li>\n\n\n\n<li><strong>lr<\/strong> is the abbreviation for learning rate and represents the rate at which the model&#8217;s weights are updated during gradient descent (backward pass or backward propagation)<\/li>\n<\/ul>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">epochs = 700\nlr = 0.1\nlosses = list()\nfor epoch in range(epochs):\n    # On s\u00e9lectionne un point de donn\u00e9es al\u00e9atoire parmi les 10 du dataset\n    # Cela permet de varier les donn\u00e9es vues \u00e0 chaque epoch\n    ix = randint(0, len(data) - 1)\n    x = data.iloc[ix][&quot;x&quot;]\n    y = data.iloc[ix][&quot;y&quot;]\n    # Forward pass\n    y_prevision = M @ torch.tensor([x]).float()\n    # Calcul de la loss (perte)\n    loss = F.l1_loss(y_prevision, torch.Tensor([y]))\n    # Backward pass\n    M.grad = None\n    loss.backward()\n    # Mise \u00e0 jour du learning rate et de M\n    lr = 0.1 # On conserve le m\u00eame learning rate\n    M.data += -lr * M.grad\n    # stats : on stocke la loss pour suivre la progression de l&#039;entra\u00eenement\n    losses.append(loss.item())<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\"><strong><strong><strong><strong><strong>Displaying and Interpreting Results<\/strong><\/strong><\/strong><\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">During training, we stored the loss for each epoch; we can now visualize how this loss evolved throughout the model&#8217;s training.<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">plt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.plot(range(epochs), losses, linestyle=&#039;-&#039;, color=&#039;b&#039;, label=&quot;Loss&quot;)\nplt.xlabel(&quot;Epochs&quot;)\nplt.ylabel(&quot;Loss&quot;)\nplt.title(&quot;\u00c9volution de la loss au fil des epochs&quot;)\nplt.legend()\nplt.grid(True)\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"237\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_lr-1024x237.png\" alt=\"\" class=\"wp-image-1461\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_lr-1024x237.png 1024w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_lr-300x69.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_lr-768x178.png 768w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_lr.png 1443w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">We observe that our model <strong>converges<\/strong> very <strong>quickly<\/strong>, but still struggles to stabilize (the magnitude of the <strong>oscillations<\/strong> remains identical throughout training).<\/p>\n\n<p class=\"wp-block-paragraph\">We can also see the impact on data predictions. In other words, are the predictions close to the actual slope? To do this, simply apply our trained model to the initial dataset.  <\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">predictions = []\nfor x in data[&quot;x&quot;]: # Pour chaque x du jeu de donn\u00e9es original\n    y_pred = (M * x).item() # On applique notre mod\u00e8le entra\u00een\u00e9 : y = M * x\n    predictions.append((x, y_pred))\nplt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.scatter(data[&quot;x&quot;], data[&quot;y&quot;], alpha=0.5, label=&quot;Donn\u00e9es r\u00e9elles&quot;)\nplt.plot([x[0] for x in predictions], [y[1] for y in predictions], label=&quot;Pr\u00e9dictions&quot;, color=&#039;r&#039;)\nplt.title(&quot;Donn\u00e9es r\u00e9elles vs Pr\u00e9dictions&quot;)\nplt.xlabel(&quot;Position x&quot;)\nplt.ylabel(&quot;Altitude y&quot;)\nplt.grid(True)\nplt.legend()\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"236\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_pred-1024x236.png\" alt=\"\" class=\"wp-image-1462\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_pred-1024x236.png 1024w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_pred-300x69.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_pred-768x177.png 768w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_high_lr_pred.png 1446w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">We can see that our model makes predictions quite close to the real data, but they are not entirely accurate. Let&#8217;s see if we can improve our training. <\/p>\n\n<h2 class=\"wp-block-heading\"><strong><strong><strong><strong><strong><strong>Alternative Model Training<\/strong><\/strong><\/strong><\/strong><\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">To improve our model&#8217;s predictions, we can try adjusting the <strong>learning rate<\/strong>.<\/p>\n\n<p class=\"wp-block-paragraph\">For our first test, we used a <strong>high learning rate<\/strong> (0.1), which means that at each iteration, the model&#8217;s parameters (<strong>weights<\/strong> and <strong>biases<\/strong>) are <strong>greatly adjusted<\/strong> (which explains the oscillations in the loss).<\/p>\n\n<p class=\"wp-block-paragraph\">So, we will now attempt the same training, but with a low learning rate (0.001).<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">torch.manual_seed(1337)\nseed(1337)\nM = torch.randn((1,1))\nM.requires_grad = True\nprint(M)\nepochs = 700 # On conserve le m\u00eame nombre d&#039;epochs que pour le mod\u00e8le pr\u00e9c\u00e9dent\nlr = 0.001 # On choisit un learning rate plus faible pour voir son impact sur la convergence du mod\u00e8le\nlosses = list()\nfor epoch in range(epochs):\n    # \u00c9chantillon al\u00e9atoire\n    ix = randint(0, len(data) - 1)\n    x = data.iloc[ix][&quot;x&quot;]\n    y = data.iloc[ix][&quot;y&quot;]\n    # Forward pass\n    y_prevision = M @ torch.tensor([x]).float()\n    # Calcul de la loss\n    loss = F.l1_loss(y_prevision, torch.Tensor([y]))\n    # Backward pass\n    M.grad = None\n    loss.backward()\n    # Mise \u00e0 jour\n    lr = 0.001 # On conserve le learning rate faible\n    M.data += -lr * M.grad\n    # stats\n    losses.append(loss.item())\n# Pr\u00e9dictions finales pour les comparer avec les donn\u00e9es r\u00e9elles plus tard\npredictions = []\nfor x in data[&quot;x&quot;]:\n    y_pred = (M * x).item()\n    predictions.append((x, y_pred))\n# Visualisation de la loss en fonction des epochs\nplt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.plot(range(epochs), losses, linestyle=&#039;-&#039;, color=&#039;b&#039;, label=&quot;Loss&quot;)\nplt.xlabel(&quot;Epochs&quot;)\nplt.ylabel(&quot;Loss&quot;)\nplt.title(&quot;\u00c9volution de la loss au fil des epochs&quot;)\nplt.legend()\nplt.grid(True)\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"237\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_low_epochs-1024x237.png\" alt=\"\" class=\"wp-image-1463\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_low_epochs-1024x237.png 1024w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_low_epochs-300x69.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_low_epochs-768x178.png 768w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_low_epochs.png 1443w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">We can observe that with a <strong>low learning rate<\/strong>, the model <strong>does not converge<\/strong> in <strong>700 epochs<\/strong> (we still have a downward slope and no plateau).<\/p>\n\n<p class=\"wp-block-paragraph\">A low learning rate means that at each iteration, the model&#8217;s parameters (weights and biases) are modified very little. We try to make small adjustments to them to converge with as few oscillations as possible at the end of training. <\/p>\n\n<p class=\"wp-block-paragraph\">Therefore, to converge with a low learning rate, we need a higher number of epochs, simply to allow the model time to converge. Consequently, we will retry the previous training, but this time, with <strong>1000 epochs<\/strong>. <\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">torch.manual_seed(1337)\nseed(1337)\nM = torch.randn((1,1))\nM.requires_grad = True\nprint(M)\nepochs = 1000 # On augmente le nombre d&#039;epochs pour voir si le mod\u00e8le fini par converger avec un learning rate faible\nlr = 0.001 # On conserve le learning rate faible\nlosses = list()\nfor epoch in range(epochs):\n    # \u00c9chantillon al\u00e9atoire\n    ix = randint(0, len(data) - 1)\n    x = data.iloc[ix][&quot;x&quot;]\n    y = data.iloc[ix][&quot;y&quot;]\n    # Forward pass\n    y_prevision = M @ torch.tensor([x]).float()\n    # Calcul de la loss\n    loss = F.l1_loss(y_prevision, torch.Tensor([y]))\n    # Backward pass\n    M.grad = None\n    loss.backward()\n    # Mise \u00e0 jour\n    lr = 0.001\n    M.data += -lr * M.grad\n    # stats\n    losses.append(loss.item())\n# Pr\u00e9dictions finales pour les comparer avec les donn\u00e9es r\u00e9elles plus tard\npredictions = []\nfor x in data[&quot;x&quot;]:\n    y_pred = (M * x).item()\n    predictions.append((x, y_pred))\n# Visualisation de la loss en fonction des epochs\nplt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.plot(range(epochs), losses, linestyle=&#039;-&#039;, color=&#039;b&#039;, label=&quot;Loss&quot;)\nplt.xlabel(&quot;Epochs&quot;)\nplt.ylabel(&quot;Loss&quot;)\nplt.title(&quot;\u00c9volution de la loss au fil des epochs&quot;)\nplt.legend()\nplt.grid(True)\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"237\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_high_epochs-1024x237.png\" alt=\"\" class=\"wp-image-1464\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_high_epochs-1024x237.png 1024w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_high_epochs-300x69.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_high_epochs-768x178.png 768w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_lr_high_epochs.png 1443w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">Here, we can see that with a <strong>low learning rate<\/strong> (0.001) but a <strong>large number of epochs<\/strong> (1000), the model does eventually <strong>converge<\/strong>.<\/p>\n\n<p class=\"wp-block-paragraph\">But are the model&#8217;s predictions more accurate? That&#8217;s what we&#8217;ll see next. <\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">plt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.scatter(data[&quot;x&quot;], data[&quot;y&quot;], alpha=0.5, label=&quot;Donn\u00e9es r\u00e9elles&quot;)\nplt.plot([x[0] for x in predictions], [y[1] for y in predictions], label=&quot;Pr\u00e9dictions&quot;, color=&#039;r&#039;)\nplt.title(&quot;Donn\u00e9es r\u00e9elles vs Pr\u00e9dictions&quot;)\nplt.xlabel(&quot;Position x&quot;)\nplt.ylabel(&quot;Altitude y&quot;)\nplt.grid(True)\nplt.legend()\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"236\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_pred_high_epochs-1024x236.png\" alt=\"\" class=\"wp-image-1465\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_pred_high_epochs-1024x236.png 1024w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_pred_high_epochs-300x69.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_pred_high_epochs-768x177.png 768w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_low_lr_pred_high_epochs.png 1446w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">As we can see in the graph above, the model&#8217;s <strong>predictions<\/strong> are indeed <strong>better<\/strong> with a <strong>low learning rate<\/strong>! \ud83c\udf89<\/p>\n\n<h2 class=\"wp-block-heading\"><strong><strong><strong><strong><strong><strong><strong>Optimal Model Training<\/strong><\/strong><\/strong><\/strong><\/strong><\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">As seen previously, training with a high learning rate and a low learning rate both have their advantages and disadvantages.<\/p>\n\n<p class=\"wp-block-paragraph\">On one hand, a high learning rate allows the model to converge very quickly, but with large oscillations, which can sometimes mean the loss never stabilizes and thus the model can make poor predictions. On the other hand, a low learning rate ensures a stable loss at the end of training, but with a large number of epochs, leading to longer training and higher computational cost. <\/p>\n\n<p class=\"wp-block-paragraph\">To get the best of both worlds, we will try training our model with an <strong>adaptive learning rate<\/strong>: high initially to converge quickly, then low to stabilize the loss.<\/p>\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"\" data-line=\"\">torch.manual_seed(1337)\nseed(1337)\nM = torch.randn((1,1))\nM.requires_grad = True\nprint(M)\nepochs = 150 # On repasse \u00e0 un nombre d&#039;epochs faible\nlr_initial = 0.1 # On commence \u00e0 un learning rate \u00e9lev\u00e9 pour converger rapidement\nlr_final = 0.001 # On fini \u00e0 un learning rate faible pour stabiliser la loss\nlosses = list()\nfor epoch in range(epochs):\n    # \u00c9chantillon al\u00e9atoire\n    ix = randint(0, len(data) - 1)\n    x = data.iloc[ix][&quot;x&quot;]\n    y = data.iloc[ix][&quot;y&quot;]\n    # Forward pass\n    y_prevision = M @ torch.tensor([x]).float()\n    # Calcul de la loss\n    loss = F.l1_loss(y_prevision, torch.Tensor([y]))\n    # Backward pass\n    M.grad = None\n    loss.backward()\n    # Mise \u00e0 jour\n    if epoch &lt; 50:\n        lr = lr_initial # Pour les 50 premi\u00e8res epochs, on conserve le learning rate initial (\u00e9lev\u00e9 : 0,1)\n    else:\n        lr = lr_final # Pass\u00e9 la barre des 50 premi\u00e8res epochs, on passe \u00e0 au learning rate final (faible : 0,001)\n    M.data += -lr * M.grad\n    # stats\n    losses.append(loss.item())\n# Visualisation de la loss en fonction des epochs\nplt.figure(figsize=(25, 5))\nplt.margins(0)\nplt.plot(range(epochs), losses, linestyle=&#039;-&#039;, color=&#039;b&#039;, label=&quot;Loss&quot;)\nplt.xlabel(&quot;Epochs&quot;)\nplt.ylabel(&quot;Loss&quot;)\nplt.title(&quot;\u00c9volution de la loss au fil des epochs&quot;)\nplt.legend()\nplt.grid(True)\nplt.show()<\/code><\/pre>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"237\" src=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_adapt_lr_lr-1024x237.png\" alt=\"\" class=\"wp-image-1466\" srcset=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_adapt_lr_lr-1024x237.png 1024w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_adapt_lr_lr-300x69.png 300w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_adapt_lr_lr-768x178.png 768w, https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/opt_simple_rnn_adapt_lr_lr.png 1443w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p class=\"wp-block-paragraph\">We observe that with an <strong>adaptive<\/strong> learning rate, the model <strong>converges<\/strong> very well and the loss <strong>stabilizes<\/strong> in a very <strong>low<\/strong> <strong>number of epochs<\/strong>!<\/p>\n\n<p class=\"wp-block-paragraph\">So, an adaptive learning rate is a better solution (in terms of efficiency and performance) for training a model. The training cost is lower, and the model makes better predictions. <\/p>\n\n<p class=\"wp-block-paragraph\">This adaptation function is actually called a <strong>scheduler<\/strong>, and it serves to dynamically adjust a training hyperparameter. In our case, the hyperparameter is the learning rate, so we speak more specifically of an <strong>lr scheduler<\/strong>. <\/p>\n\n<p class=\"wp-block-paragraph\">For our lr scheduler, we created a very simple function. We start with a high learning rate, then, after 50 epochs, we switch to a low learning rate. <\/p>\n\n<p class=\"wp-block-paragraph\">However, we could also improve this function by adapting our learning rate based on the last calculated loss (and not the epoch, which is a somewhat naive variable): as long as the loss decreases, we keep the current learning rate; otherwise, we divide it by two. Feel free to test this version on your own if you&#8217;d like! <\/p>\n\n<h2 class=\"wp-block-heading\"><strong><strong><strong><strong><strong><strong><strong><strong>Conclusion<\/strong><\/strong><\/strong><\/strong><\/strong><\/strong><\/strong><\/strong><\/h2>\n\n<p class=\"wp-block-paragraph\">To conclude, in this tutorial, we explored the concepts of <strong>learning rate<\/strong> and <strong>scheduler<\/strong>, fundamental aspects of neural network training.<\/p>\n\n<p class=\"wp-block-paragraph\">Through different training sessions, we observed that:<\/p>\n\n<p class=\"wp-block-paragraph\">\u2705 The backward pass allows adjusting model parameters by minimizing a loss function.<\/p>\n\n<p class=\"wp-block-paragraph\">\u2705 The choice of learning rate is crucial: too high, the loss is unstable; too low, it becomes too slow.<\/p>\n\n<p class=\"wp-block-paragraph\">\u2705 An adaptive learning rate accelerates convergence initially and stabilizes learning afterward.<\/p>\n\n<p class=\"wp-block-paragraph\">\u2705 There are several ways to adapt the learning rate, and the functions for adapting it are called schedulers.<\/p>\n\n<p class=\"wp-block-paragraph\">Feel free to try out this tutorial on your own to master neural network creation and training. For example, you can test <strong>different learning rates<\/strong> or <strong>lr schedulers<\/strong> for your model&#8217;s training! \ud83d\ude80 <\/p>\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n<p class=\"wp-block-paragraph\">Author: Mathilde POMMIER, Neogeo<\/p>\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After learning how to create your first neural network in the article My First Neural Network and studying the theory of model optimization in the article Simple Neural Network Optimization, it&#8217;s now time to practice effectively training a neural network! \ud83d\ude80 To do this, we will revisit the model creation from the article My First &#8230; <a title=\"Tutorial: Effectively Train My First Neural Network\" class=\"read-more\" href=\"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/\" aria-label=\"Read more about Tutorial: Effectively Train My First Neural Network\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":4866,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[],"class_list":["post-4865","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>Learning Rate Tutorial: Training a Neural Network | NEOGEO<\/title>\n<meta name=\"description\" content=\"Step-by-step PyTorch tutorial: comparative training sessions to measure the importance of the learning rate in neural network training.\" \/>\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\/tutorial-effectively-train-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=\"Learning Rate Tutorial: Training a Neural Network | NEOGEO\" \/>\n<meta property=\"og:description\" content=\"Step-by-step PyTorch tutorial: comparative training sessions to measure the importance of the learning rate in neural network training.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/\" \/>\n<meta property=\"og:site_name\" content=\"NEOGEO\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-22T13:39:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-23T14:23:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/20945482-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=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/\"},\"author\":{\"name\":\"Philippe DESTR\u00c9\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#\\\/schema\\\/person\\\/69685e84302b110f77d59dc8ee6e2d40\"},\"headline\":\"Tutorial: Effectively Train My First Neural Network\",\"datePublished\":\"2025-04-22T13:39:01+00:00\",\"dateModified\":\"2026-10-23T14:23:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/\"},\"wordCount\":1287,\"publisher\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/20945482-scaled-1.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/\",\"name\":\"Learning Rate Tutorial: Training a Neural Network | NEOGEO\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/20945482-scaled-1.jpg\",\"datePublished\":\"2025-04-22T13:39:01+00:00\",\"dateModified\":\"2026-10-23T14:23:28+00:00\",\"description\":\"Step-by-step PyTorch tutorial: comparative training sessions to measure the importance of the learning rate in neural network training.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#primaryimage\",\"url\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/20945482-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/neogeo.fr\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/20945482-scaled-1.jpg\",\"width\":2560,\"height\":1707,\"caption\":\"Technical support guys working on repairing computer hardware and software. Troubleshooting, fixing problems, problem checking concept. Pinkish coral blue vector isolated illustration\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/tutorial-effectively-train-my-first-neural-network\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/neogeo.fr\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorial: Effectively Train 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":"Learning Rate Tutorial: Training a Neural Network | NEOGEO","description":"Step-by-step PyTorch tutorial: comparative training sessions to measure the importance of the learning rate in neural network training.","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\/tutorial-effectively-train-my-first-neural-network\/","og_locale":"en_US","og_type":"article","og_title":"Learning Rate Tutorial: Training a Neural Network | NEOGEO","og_description":"Step-by-step PyTorch tutorial: comparative training sessions to measure the importance of the learning rate in neural network training.","og_url":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/","og_site_name":"NEOGEO","article_published_time":"2025-04-22T13:39:01+00:00","article_modified_time":"2026-10-23T14:23:28+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/20945482-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":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#article","isPartOf":{"@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/"},"author":{"name":"Philippe DESTR\u00c9","@id":"https:\/\/neogeo.fr\/en\/#\/schema\/person\/69685e84302b110f77d59dc8ee6e2d40"},"headline":"Tutorial: Effectively Train My First Neural Network","datePublished":"2025-04-22T13:39:01+00:00","dateModified":"2026-10-23T14:23:28+00:00","mainEntityOfPage":{"@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/"},"wordCount":1287,"publisher":{"@id":"https:\/\/neogeo.fr\/en\/#organization"},"image":{"@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#primaryimage"},"thumbnailUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/20945482-scaled-1.jpg","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/","url":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/","name":"Learning Rate Tutorial: Training a Neural Network | NEOGEO","isPartOf":{"@id":"https:\/\/neogeo.fr\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#primaryimage"},"image":{"@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#primaryimage"},"thumbnailUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/20945482-scaled-1.jpg","datePublished":"2025-04-22T13:39:01+00:00","dateModified":"2026-10-23T14:23:28+00:00","description":"Step-by-step PyTorch tutorial: comparative training sessions to measure the importance of the learning rate in neural network training.","breadcrumb":{"@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#primaryimage","url":"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/20945482-scaled-1.jpg","contentUrl":"https:\/\/neogeo.fr\/wp-content\/uploads\/2025\/04\/20945482-scaled-1.jpg","width":2560,"height":1707,"caption":"Technical support guys working on repairing computer hardware and software. Troubleshooting, fixing problems, problem checking concept. Pinkish coral blue vector isolated illustration"},{"@type":"BreadcrumbList","@id":"https:\/\/neogeo.fr\/en\/tutorial-effectively-train-my-first-neural-network\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/neogeo.fr\/en\/"},{"@type":"ListItem","position":2,"name":"Tutorial: Effectively Train 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\/4865","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=4865"}],"version-history":[{"count":1,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/posts\/4865\/revisions"}],"predecessor-version":[{"id":4867,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/posts\/4865\/revisions\/4867"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/media\/4866"}],"wp:attachment":[{"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/media?parent=4865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/categories?post=4865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neogeo.fr\/en\/wp-json\/wp\/v2\/tags?post=4865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}