From f82371e8efc6e4323d6893ff693e0c91c2f76aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Morales?= Date: Tue, 21 Nov 2023 12:03:34 -0600 Subject: [PATCH] split losses description (#828) --- nbs/losses.numpy.ipynb | 14 ++++++++++++-- nbs/losses.pytorch.ipynb | 19 ++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/nbs/losses.numpy.ipynb b/nbs/losses.numpy.ipynb index f7c32499e..4b56c22ef 100644 --- a/nbs/losses.numpy.ipynb +++ b/nbs/losses.numpy.ipynb @@ -21,13 +21,23 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# NumPy Evaluation\n", "\n", - "> NeuralForecast contains a collection NumPy loss functions aimed to be used during the models' evaluation. The most important train signal is the forecast error, which is the difference between the observed value $y_{\\tau}$ and the prediction $\\hat{y}_{\\tau}$, at time $y_{\\tau}$:$$e_{\\tau} = y_{\\tau}-\\hat{y}_{\\tau} \\qquad \\qquad \\tau \\in \\{t+1,\\dots,t+H \\}$$ The train loss summarizes the forecast errors in different evaluation metrics.

" + "> NeuralForecast contains a collection NumPy loss functions aimed to be used during the models' evaluation." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The most important train signal is the forecast error, which is the difference between the observed value $y_{\\tau}$ and the prediction $\\hat{y}_{\\tau}$, at time $y_{\\tau}$:\n", + "\n", + "$$e_{\\tau} = y_{\\tau}-\\hat{y}_{\\tau} \\qquad \\qquad \\tau \\in \\{t+1,\\dots,t+H \\}$$\n", + "\n", + "The train loss summarizes the forecast errors in different evaluation metrics." ] }, { diff --git a/nbs/losses.pytorch.ipynb b/nbs/losses.pytorch.ipynb index f73c8e452..6e5b0e51e 100644 --- a/nbs/losses.pytorch.ipynb +++ b/nbs/losses.pytorch.ipynb @@ -23,14 +23,27 @@ ] }, { - "attachments": {}, "cell_type": "markdown", - "id": "12fa25a4", + "id": "fd532cb1-d11d-468e-a0e5-eb1101ba6662", "metadata": {}, "source": [ "# PyTorch Losses\n", "\n", - "> NeuralForecast contains a collection PyTorch Loss classes aimed to be used during the models' optimization. The most important train signal is the forecast error, which is the difference between the observed value $y_{\\tau}$ and the prediction $\\hat{y}_{\\tau}$, at time $y_{\\tau}$:$$e_{\\tau} = y_{\\tau}-\\hat{y}_{\\tau} \\qquad \\qquad \\tau \\in \\{t+1,\\dots,t+H \\}$$ The train loss summarizes the forecast errors in different train optimization objectives.

All the losses are `torch.nn.modules` which helps to automatically moved them across CPU/GPU/TPU devices with Pytorch Lightning. " + "> NeuralForecast contains a collection PyTorch Loss classes aimed to be used during the models' optimization." + ] + }, + { + "cell_type": "markdown", + "id": "096cfbec-1d59-454a-b572-5890103b2f1f", + "metadata": {}, + "source": [ + "The most important train signal is the forecast error, which is the difference between the observed value $y_{\\tau}$ and the prediction $\\hat{y}_{\\tau}$, at time $y_{\\tau}$:\n", + "\n", + "$$e_{\\tau} = y_{\\tau}-\\hat{y}_{\\tau} \\qquad \\qquad \\tau \\in \\{t+1,\\dots,t+H \\}$$\n", + "\n", + "The train loss summarizes the forecast errors in different train optimization objectives.\n", + "\n", + "All the losses are `torch.nn.modules` which helps to automatically moved them across CPU/GPU/TPU devices with Pytorch Lightning. " ] }, {