Building NARX Neural Network using Sysidentpy

Example created by Wilson Rocha Lacerda Junior

Series-Parallen Training and Parallel prediction

Currently SysIdentPy support a Series-Parallel (open-loop) Feedforward Network training process, which make the training process easier. We convert the NARX network from Series-Parallel to the Parallel (closed-loop) configuration for prediction.

Series-Parallel allows us to use Pytorch directly for training, so we can use all the power of the Pytorch library to build our NARX Neural Network model!

The reader is referred to the following paper for a more in depth discussion about Series-Parallel and Parallel configurations regarding NARX neural network:

Parallel Training Considered Harmful?: Comparing series-parallel and parallel feedforward network training

Building a NARX Neural Network

First, just import the necessary packages

pip install sysidentpy
Requirement already satisfied: sysidentpy in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (0.1.6)
Requirement already satisfied: matplotlib>=3.3.2 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from sysidentpy) (3.4.3)
Requirement already satisfied: scipy>=1.7.0 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from sysidentpy) (1.7.1)
Requirement already satisfied: numpy>=1.19.2 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from sysidentpy) (1.20.3)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (2.8.2)
Requirement already satisfied: cycler>=0.10 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (8.3.2)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (1.3.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (2.4.7)
Requirement already satisfied: six in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from cycler>=0.10->matplotlib>=3.3.2->sysidentpy) (1.16.0)
Note: you may need to restart the kernel to use updated packages.
from torch import nn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sysidentpy.metrics import mean_squared_error
from sysidentpy.utils.generate_data import get_siso_data
from sysidentpy.neural_network import NARXNN

Getting the data

The data is generated by simulating the following model:

\(y_k = 0.2y_{k-1} + 0.1y_{k-1}x_{k-1} + 0.9x_{k-1} + e_{k}\).

If colored_noise is set to True:

\(e_{k} = 0.8\nu_{k-1} + \nu_{k}\),

where \(x\) is a uniformly distributed random variable and \(\nu\) is a gaussian distributed variable with \(\mu=0\) and \(\sigma=0.1\)

x_train, x_valid, y_train, y_valid = get_siso_data(n=1000,
                                                   colored_noise=False,
                                                   sigma=0.01,
                                                   train_percentage=80)

Choosing the NARX parameters, loss function and optmizer

One can create a NARXNN object and choose the maximum lag of both input and output for building the regressor matrix to serve as input of the network.

In addition, you can choose the loss function, the optmizer, the optinional parameters of the optmizer, the number of epochs.

Because we built this feature on top of Pytorch, you can choose any of the loss function of the torch.nn.functional. Click here for a list of the loss functions you can use. You just need to pass the name of the loss function you want.

Similarly, you can choose any of the optimizers of the torch.optim. Click here for a list of optimizers available.

narx_net = NARXNN(ylag=2,
                  xlag=2,
                  loss_func='mse_loss',
                  optimizer='Adam',
                  epochs=200,
                  verbose=True,
                  optim_params={'betas': (0.9, 0.999), 'eps': 1e-05} # optional parameters of the optimizer
)

Since we have defined our NARXNN using \(ylag=2\) and \(xlag=2\), we have a regressor matrix with 4 features. We need the size of the regressor matrix to build the layers of our network. Our input data(x_train) have only one feature, but since we are creating an NARX network, a regressor matrix is built behind the scenes with new features based on the xlag and ylag.

You can check the size the of the regressor matrix by using the following line of code:

len(narx_net.regressor_code) # the number of features of the NARX net
4

Building the NARX Neural Network

The configuration of your network follows exactly the same pattern of a network defined in Pytorch. The following representing our NARX neural network.

class NARX(nn.Module):
    def __init__(self):
        super().__init__()
        self.lin = nn.Linear(4, 10)
        self.lin2 = nn.Linear(10, 10)
        self.lin3 = nn.Linear(10, 1)
        self.tanh = nn.Tanh()

    def forward(self, xb):
        z = self.lin(xb)
        z = self.tanh(z)
        z = self.lin2(z)
        z = self.tanh(z)
        z = self.lin3(z)
        return z

We have to pass the defined network to our NARXNN estimator.

narx_net.net = NARX() 

Numpy array to Tensor

If your inputs are numpy array, you can transform them to tensor using our data_transform method. Our function return a Dataloader object that we use to iterate on our training function. You can transform your inputs mannualy using TensorDataset and Dataloader using Pytorch.

Since our inputs are numpy arrays, we transform them using the following:

train_dl = narx_net.data_transform(x_train, y_train)
valid_dl = narx_net.data_transform(x_valid, y_valid)

Fit and Predict

Because we have a fit (for training) and predict function for Polynomial NARMAX, we create the same pattern for the NARX net. So, you only have to fit and predict using the following:

narx_net.fit(train_dl, valid_dl)
yhat = narx_net.predict(x_valid, y_valid)
10-24 13:11:18 - INFO - Train metrics: 0.16806536382601076 | Validation metrics: 0.19143791511805372
10-24 13:11:18 - INFO - Train metrics: 0.04396688168807735 | Validation metrics: 0.05291818944041175
10-24 13:11:18 - INFO - Train metrics: 0.018999136680909863 | Validation metrics: 0.019625746616811462
10-24 13:11:18 - INFO - Train metrics: 0.00973955181691058 | Validation metrics: 0.011352929766431
10-24 13:11:18 - INFO - Train metrics: 0.00794094160110468 | Validation metrics: 0.01032234225045852
10-24 13:11:18 - INFO - Train metrics: 0.005137437730467409 | Validation metrics: 0.006661770583102198
10-24 13:11:18 - INFO - Train metrics: 0.004405114736716102 | Validation metrics: 0.005433360401616253
10-24 13:11:18 - INFO - Train metrics: 0.0033278282280115035 | Validation metrics: 0.004189286503301124
10-24 13:11:18 - INFO - Train metrics: 0.0031792024812219957 | Validation metrics: 0.004398279494107372
10-24 13:11:18 - INFO - Train metrics: 0.002685105367120178 | Validation metrics: 0.003483336679919651
10-24 13:11:18 - INFO - Train metrics: 0.002477162881149796 | Validation metrics: 0.003195261942561377
10-24 13:11:18 - INFO - Train metrics: 0.0022668421223530906 | Validation metrics: 0.003088613221835759
10-24 13:11:18 - INFO - Train metrics: 0.002087549311995861 | Validation metrics: 0.0027197964484756343
10-24 13:11:18 - INFO - Train metrics: 0.0019387531562248493 | Validation metrics: 0.0025245971281570617
10-24 13:11:18 - INFO - Train metrics: 0.0018047694925610955 | Validation metrics: 0.0023919838066730234
10-24 13:11:18 - INFO - Train metrics: 0.0016937999840811791 | Validation metrics: 0.0021980560497578345
10-24 13:11:18 - INFO - Train metrics: 0.0015963944335139 | Validation metrics: 0.002047549963768835
10-24 13:11:18 - INFO - Train metrics: 0.0015026465527197452 | Validation metrics: 0.001939540688945639
10-24 13:11:18 - INFO - Train metrics: 0.0014219466739224462 | Validation metrics: 0.0018108760693458595
10-24 13:11:18 - INFO - Train metrics: 0.0013502024320995243 | Validation metrics: 0.0017000608607148282
10-24 13:11:18 - INFO - Train metrics: 0.001281261479833343 | Validation metrics: 0.0016031437141896046
10-24 13:11:18 - INFO - Train metrics: 0.0012172459304346738 | Validation metrics: 0.0015077988553622906
10-24 13:11:18 - INFO - Train metrics: 0.0011580369925712304 | Validation metrics: 0.0014218501805450129
10-24 13:11:18 - INFO - Train metrics: 0.0011028099321074 | Validation metrics: 0.0013382973259954592
10-24 13:11:18 - INFO - Train metrics: 0.0010508070565657434 | Validation metrics: 0.001260646965796824
10-24 13:11:18 - INFO - Train metrics: 0.0010017021489154576 | Validation metrics: 0.0011876036749324864
10-24 13:11:18 - INFO - Train metrics: 0.0009556427967961046 | Validation metrics: 0.0011183543311845926
10-24 13:11:18 - INFO - Train metrics: 0.0009129859323561995 | Validation metrics: 0.001053783763905592
10-24 13:11:18 - INFO - Train metrics: 0.0008739300947788085 | Validation metrics: 0.0009934645912826362
10-24 13:11:18 - INFO - Train metrics: 0.0008390102352256091 | Validation metrics: 0.0009382788710427856
10-24 13:11:18 - INFO - Train metrics: 0.0008085266560640532 | Validation metrics: 0.0008885255248069462
10-24 13:11:18 - INFO - Train metrics: 0.0007829209028119992 | Validation metrics: 0.0008447706873406365
10-24 13:11:18 - INFO - Train metrics: 0.0007622455078104796 | Validation metrics: 0.0008073412846171796
10-24 13:11:18 - INFO - Train metrics: 0.0007461250246441772 | Validation metrics: 0.0007761061683090196
10-24 13:11:18 - INFO - Train metrics: 0.0007334773127925594 | Validation metrics: 0.0007504023431630975
10-24 13:11:18 - INFO - Train metrics: 0.0007223450626307319 | Validation metrics: 0.0007286668182444768
10-24 13:11:18 - INFO - Train metrics: 0.000710040292665269 | Validation metrics: 0.0007086822003445993
10-24 13:11:18 - INFO - Train metrics: 0.0006935876462419511 | Validation metrics: 0.0006878220375081656
10-24 13:11:18 - INFO - Train metrics: 0.0006705832031303386 | Validation metrics: 0.0006639026146560833
10-24 13:11:18 - INFO - Train metrics: 0.0006402221338807099 | Validation metrics: 0.0006360281893814152
10-24 13:11:18 - INFO - Train metrics: 0.0006039775039254918 | Validation metrics: 0.0006052230642355904
10-24 13:11:18 - INFO - Train metrics: 0.0005654076182570561 | Validation metrics: 0.0005742111866541132
10-24 13:11:18 - INFO - Train metrics: 0.0005289371372527329 | Validation metrics: 0.0005462999706100109
10-24 13:11:18 - INFO - Train metrics: 0.0004980927699404234 | Validation metrics: 0.0005238023386666119
10-24 13:11:18 - INFO - Train metrics: 0.0004741801520842209 | Validation metrics: 0.0005069396427992468
10-24 13:11:18 - INFO - Train metrics: 0.0004561831443780627 | Validation metrics: 0.0004939413794099983
10-24 13:11:18 - INFO - Train metrics: 0.00044187412060094636 | Validation metrics: 0.00048228372546910034
10-24 13:11:18 - INFO - Train metrics: 0.0004292757090333999 | Validation metrics: 0.00047017543957653373
10-24 13:11:18 - INFO - Train metrics: 0.00041742734395126276 | Validation metrics: 0.00045723689959920716
10-24 13:11:18 - INFO - Train metrics: 0.000406168837142282 | Validation metrics: 0.00044407057423012875
10-24 13:11:18 - INFO - Train metrics: 0.0003955648114372577 | Validation metrics: 0.0004313900482351657
10-24 13:11:18 - INFO - Train metrics: 0.0003856074255786108 | Validation metrics: 0.0004194889034172802
10-24 13:11:18 - INFO - Train metrics: 0.0003761893277170888 | Validation metrics: 0.0004082127439558995
10-24 13:11:18 - INFO - Train metrics: 0.000367183133231518 | Validation metrics: 0.0003972713399861911
10-24 13:11:18 - INFO - Train metrics: 0.0003585538259832268 | Validation metrics: 0.00038659100413717556
10-24 13:11:18 - INFO - Train metrics: 0.00035035885897591096 | Validation metrics: 0.0003763399321487117
10-24 13:11:18 - INFO - Train metrics: 0.00034263417033424934 | Validation metrics: 0.00036665353209081324
10-24 13:11:18 - INFO - Train metrics: 0.00033535009669023274 | Validation metrics: 0.00035749619175219025
10-24 13:11:18 - INFO - Train metrics: 0.0003284660708054172 | Validation metrics: 0.0003487938874509336
10-24 13:11:18 - INFO - Train metrics: 0.00032197563746479575 | Validation metrics: 0.0003405610685039199
10-24 13:11:19 - INFO - Train metrics: 0.0003158814276838185 | Validation metrics: 0.00033283804988987144
10-24 13:11:19 - INFO - Train metrics: 0.0003101695738155115 | Validation metrics: 0.0003256125903613113
10-24 13:11:19 - INFO - Train metrics: 0.0003048215939063476 | Validation metrics: 0.0003188591540998055
10-24 13:11:19 - INFO - Train metrics: 0.00029982068694959905 | Validation metrics: 0.00031257243950456154
10-24 13:11:19 - INFO - Train metrics: 0.0002951459564679398 | Validation metrics: 0.00030673643770495973
10-24 13:11:19 - INFO - Train metrics: 0.0002907782002792164 | Validation metrics: 0.0003013226222435031
10-24 13:11:19 - INFO - Train metrics: 0.0002867004446502084 | Validation metrics: 0.00029631170933370034
10-24 13:11:19 - INFO - Train metrics: 0.0002828918471535607 | Validation metrics: 0.0002916796844937095
10-24 13:11:19 - INFO - Train metrics: 0.00027933291872650533 | Validation metrics: 0.0002873969752920058
10-24 13:11:19 - INFO - Train metrics: 0.00027600661794571 | Validation metrics: 0.00028344171152290223
10-24 13:11:19 - INFO - Train metrics: 0.00027289557095499183 | Validation metrics: 0.0002797882632949775
10-24 13:11:19 - INFO - Train metrics: 0.0002699841836812838 | Validation metrics: 0.0002764131126553761
10-24 13:11:19 - INFO - Train metrics: 0.00026725824685407834 | Validation metrics: 0.00027329523781916557
10-24 13:11:19 - INFO - Train metrics: 0.0002647048293278532 | Validation metrics: 0.0002704161896036392
10-24 13:11:19 - INFO - Train metrics: 0.0002623123319132165 | Validation metrics: 0.00026775665041482586
10-24 13:11:19 - INFO - Train metrics: 0.00026007000519427236 | Validation metrics: 0.0002653024167015283
10-24 13:11:19 - INFO - Train metrics: 0.0002579685918552647 | Validation metrics: 0.0002630384382556635
10-24 13:11:19 - INFO - Train metrics: 0.0002560000447235432 | Validation metrics: 0.00026095210165349823
10-24 13:11:19 - INFO - Train metrics: 0.0002541562128665607 | Validation metrics: 0.00025903340781841314
10-24 13:11:19 - INFO - Train metrics: 0.00025243047975823004 | Validation metrics: 0.00025727059762699133
10-24 13:11:19 - INFO - Train metrics: 0.00025081688538631353 | Validation metrics: 0.0002556569286918437
10-24 13:11:19 - INFO - Train metrics: 0.0002493100071382501 | Validation metrics: 0.0002541837615849958
10-24 13:11:19 - INFO - Train metrics: 0.00024790461515053117 | Validation metrics: 0.000252844152250092
10-24 13:11:19 - INFO - Train metrics: 0.0002465965035549461 | Validation metrics: 0.0002516325203951147
10-24 13:11:19 - INFO - Train metrics: 0.0002453811821921082 | Validation metrics: 0.0002505424355434235
10-24 13:11:19 - INFO - Train metrics: 0.00024425542538747527 | Validation metrics: 0.00024957026765361955
10-24 13:11:19 - INFO - Train metrics: 0.00024321539063306577 | Validation metrics: 0.0002487111599137536
10-24 13:11:19 - INFO - Train metrics: 0.0002422578160021977 | Validation metrics: 0.00024796139320706705
10-24 13:11:19 - INFO - Train metrics: 0.00024137997091368523 | Validation metrics: 0.00024731677423014937
10-24 13:11:19 - INFO - Train metrics: 0.00024057884789877257 | Validation metrics: 0.0002467753903615768
10-24 13:11:19 - INFO - Train metrics: 0.00023985213663120915 | Validation metrics: 0.0002463330782837037
10-24 13:11:19 - INFO - Train metrics: 0.00023919706298347637 | Validation metrics: 0.0002459877986705514
10-24 13:11:19 - INFO - Train metrics: 0.00023861152546207203 | Validation metrics: 0.00024573670493231877
10-24 13:11:19 - INFO - Train metrics: 0.00023809398743580737 | Validation metrics: 0.00024557861792290527
10-24 13:11:19 - INFO - Train metrics: 0.00023764203230203842 | Validation metrics: 0.0002455104532242386
10-24 13:11:19 - INFO - Train metrics: 0.00023725346552983 | Validation metrics: 0.000245530990239308
10-24 13:11:19 - INFO - Train metrics: 0.0002369274141866233 | Validation metrics: 0.0002456379368209816
10-24 13:11:19 - INFO - Train metrics: 0.00023666177783657406 | Validation metrics: 0.0002458297589916096
10-24 13:11:19 - INFO - Train metrics: 0.00023645524199314435 | Validation metrics: 0.00024610559421948936
10-24 13:11:19 - INFO - Train metrics: 0.00023630646806248792 | Validation metrics: 0.00024646262237284746
10-24 13:11:19 - INFO - Train metrics: 0.0002362137932968174 | Validation metrics: 0.0002468997963017436
10-24 13:11:19 - INFO - Train metrics: 0.00023617481980309414 | Validation metrics: 0.00024741312642958055
10-24 13:11:19 - INFO - Train metrics: 0.00023618784719549427 | Validation metrics: 0.0002480009344354686
10-24 13:11:19 - INFO - Train metrics: 0.00023625067233593486 | Validation metrics: 0.0002486589726300515
10-24 13:11:19 - INFO - Train metrics: 0.00023635987227842126 | Validation metrics: 0.00024938184710341797
10-24 13:11:19 - INFO - Train metrics: 0.00023651110066858383 | Validation metrics: 0.00025016204524559504
10-24 13:11:19 - INFO - Train metrics: 0.0002366997200772773 | Validation metrics: 0.00025099232461247027
10-24 13:11:19 - INFO - Train metrics: 0.0002369191774378944 | Validation metrics: 0.0002518606315145852
10-24 13:11:19 - INFO - Train metrics: 0.0002371611570055949 | Validation metrics: 0.00025275215768782105
10-24 13:11:19 - INFO - Train metrics: 0.00023741610433566698 | Validation metrics: 0.0002536500699470064
10-24 13:11:19 - INFO - Train metrics: 0.00023767145988525575 | Validation metrics: 0.0002545326735913716
10-24 13:11:19 - INFO - Train metrics: 0.000237914405532361 | Validation metrics: 0.0002553738724802517
10-24 13:11:19 - INFO - Train metrics: 0.00023813065111387362 | Validation metrics: 0.0002561456757842215
10-24 13:11:19 - INFO - Train metrics: 0.00023830740173979846 | Validation metrics: 0.00025682047866708177
10-24 13:11:19 - INFO - Train metrics: 0.00023843441056414392 | Validation metrics: 0.0002573700471795305
10-24 13:11:19 - INFO - Train metrics: 0.00023850770721172348 | Validation metrics: 0.0002577722438898013
10-24 13:11:19 - INFO - Train metrics: 0.0002385312288326741 | Validation metrics: 0.0002580130833784363
10-24 13:11:19 - INFO - Train metrics: 0.000238520734239414 | Validation metrics: 0.00025809218288596833
10-24 13:11:19 - INFO - Train metrics: 0.00023850460225607696 | Validation metrics: 0.00025802437037304797
10-24 13:11:19 - INFO - Train metrics: 0.00023852131248657175 | Validation metrics: 0.0002578410312340529
10-24 13:11:19 - INFO - Train metrics: 0.00023861610497532407 | Validation metrics: 0.0002575861698726775
10-24 13:11:19 - INFO - Train metrics: 0.00023882878883881844 | Validation metrics: 0.00025730784700223893
10-24 13:11:19 - INFO - Train metrics: 0.00023918010719397098 | Validation metrics: 0.00025704538836520205
10-24 13:11:19 - INFO - Train metrics: 0.0002396580774321298 | Validation metrics: 0.00025681368571546195
10-24 13:11:19 - INFO - Train metrics: 0.00024020293549392933 | Validation metrics: 0.00025659152471244035
10-24 13:11:19 - INFO - Train metrics: 0.00024070497616812737 | Validation metrics: 0.0002563132124252128
10-24 13:11:19 - INFO - Train metrics: 0.00024101231750485984 | Validation metrics: 0.00025587389451413973
10-24 13:11:19 - INFO - Train metrics: 0.0002409556722965787 | Validation metrics: 0.00025515102180464176
10-24 13:11:19 - INFO - Train metrics: 0.00024038812272947393 | Validation metrics: 0.0002540352832493043
10-24 13:11:19 - INFO - Train metrics: 0.0002392254302098432 | Validation metrics: 0.00025246817162354485
10-24 13:11:19 - INFO - Train metrics: 0.00023747499885427343 | Validation metrics: 0.0002504649774625314
10-24 13:11:19 - INFO - Train metrics: 0.000235246058183204 | Validation metrics: 0.00024812387077918633
10-24 13:11:20 - INFO - Train metrics: 0.00023272142839357772 | Validation metrics: 0.0002456001992951232
10-24 13:11:20 - INFO - Train metrics: 0.0002301126681831327 | Validation metrics: 0.00024306655563343543
10-24 13:11:20 - INFO - Train metrics: 0.0002276062535619209 | Validation metrics: 0.0002406703260012272
10-24 13:11:20 - INFO - Train metrics: 0.00022533411824758302 | Validation metrics: 0.00023851319389050883
10-24 13:11:20 - INFO - Train metrics: 0.00022336011050055435 | Validation metrics: 0.0002366459103550461
10-24 13:11:20 - INFO - Train metrics: 0.00022168869436701017 | Validation metrics: 0.00023507835129464065
10-24 13:11:20 - INFO - Train metrics: 0.0002202948558340923 | Validation metrics: 0.00023380325192284555
10-24 13:11:20 - INFO - Train metrics: 0.00021913934798524913 | Validation metrics: 0.00023280292960481172
10-24 13:11:20 - INFO - Train metrics: 0.00021818653150242206 | Validation metrics: 0.00023205769221848723
10-24 13:11:20 - INFO - Train metrics: 0.00021740442244300997 | Validation metrics: 0.0002315429661357117
10-24 13:11:20 - INFO - Train metrics: 0.00021676961957671934 | Validation metrics: 0.00023123413495451325
10-24 13:11:20 - INFO - Train metrics: 0.00021626195785143696 | Validation metrics: 0.00023110873992507807
10-24 13:11:20 - INFO - Train metrics: 0.0002158717114818551 | Validation metrics: 0.00023114880619834019
10-24 13:11:20 - INFO - Train metrics: 0.0002155876726485126 | Validation metrics: 0.0002313372720211669
10-24 13:11:20 - INFO - Train metrics: 0.00021539883262694891 | Validation metrics: 0.00023165669405687074
10-24 13:11:20 - INFO - Train metrics: 0.0002152919444330807 | Validation metrics: 0.00023208937747051206
10-24 13:11:20 - INFO - Train metrics: 0.00021525456052638806 | Validation metrics: 0.0002326187513053718
10-24 13:11:20 - INFO - Train metrics: 0.00021527112775422718 | Validation metrics: 0.0002332253303999702
10-24 13:11:20 - INFO - Train metrics: 0.00021532798248820502 | Validation metrics: 0.00023389132878616113
10-24 13:11:20 - INFO - Train metrics: 0.00021541185567930415 | Validation metrics: 0.0002345995349289774
10-24 13:11:20 - INFO - Train metrics: 0.00021550962171881438 | Validation metrics: 0.00023533189842698512
10-24 13:11:20 - INFO - Train metrics: 0.00021560906472978857 | Validation metrics: 0.0002360725637191361
10-24 13:11:20 - INFO - Train metrics: 0.00021570065415599723 | Validation metrics: 0.0002368065051445173
10-24 13:11:20 - INFO - Train metrics: 0.0002157737264341971 | Validation metrics: 0.00023751967995794433
10-24 13:11:20 - INFO - Train metrics: 0.0002158180144040689 | Validation metrics: 0.0002381992269121581
10-24 13:11:20 - INFO - Train metrics: 0.00021582641698627785 | Validation metrics: 0.0002388333780643991
10-24 13:11:20 - INFO - Train metrics: 0.00021579191421291659 | Validation metrics: 0.00023941243831138831
10-24 13:11:20 - INFO - Train metrics: 0.00021570654844755497 | Validation metrics: 0.00023992745513849037
10-24 13:11:20 - INFO - Train metrics: 0.00021556873156200105 | Validation metrics: 0.0002403726870067079
10-24 13:11:20 - INFO - Train metrics: 0.00021537152017737484 | Validation metrics: 0.00024074065173279984
10-24 13:11:20 - INFO - Train metrics: 0.00021511642007042834 | Validation metrics: 0.0002410308022235492
10-24 13:11:20 - INFO - Train metrics: 0.0002148007334109027 | Validation metrics: 0.00024123982255314148
10-24 13:11:20 - INFO - Train metrics: 0.0002144251301339629 | Validation metrics: 0.00024136819440466963
10-24 13:11:20 - INFO - Train metrics: 0.00021399194434492901 | Validation metrics: 0.00024141727051829373
10-24 13:11:20 - INFO - Train metrics: 0.0002134980799870701 | Validation metrics: 0.00024138554131654516
10-24 13:11:20 - INFO - Train metrics: 0.00021295315912226798 | Validation metrics: 0.0002412800527191862
10-24 13:11:20 - INFO - Train metrics: 0.00021234900474123526 | Validation metrics: 0.00024109825049762172
10-24 13:11:20 - INFO - Train metrics: 0.00021170304405717717 | Validation metrics: 0.00024085144487073212
10-24 13:11:20 - INFO - Train metrics: 0.00021100151551715833 | Validation metrics: 0.00024053434232212227
10-24 13:11:20 - INFO - Train metrics: 0.00021026552093004046 | Validation metrics: 0.00024016014040998098
10-24 13:11:20 - INFO - Train metrics: 0.00020947860558091297 | Validation metrics: 0.0002397243762529935
10-24 13:11:20 - INFO - Train metrics: 0.0002086664314987488 | Validation metrics: 0.0002392414230277122
10-24 13:11:20 - INFO - Train metrics: 0.00020780875777182657 | Validation metrics: 0.00023870550450572574
10-24 13:11:20 - INFO - Train metrics: 0.00020693078087724484 | Validation metrics: 0.00023813180788890507
10-24 13:11:20 - INFO - Train metrics: 0.00020601650636367742 | Validation metrics: 0.0002375151112445188
10-24 13:11:20 - INFO - Train metrics: 0.0002050853027208804 | Validation metrics: 0.00023686824230632433
10-24 13:11:20 - INFO - Train metrics: 0.00020412885453225229 | Validation metrics: 0.00023619074320345364
10-24 13:11:20 - INFO - Train metrics: 0.00020315224997160075 | Validation metrics: 0.00023548757202330637
10-24 13:11:20 - INFO - Train metrics: 0.00020216358603091495 | Validation metrics: 0.00023476741684723006
10-24 13:11:20 - INFO - Train metrics: 0.00020116036164079487 | Validation metrics: 0.00023403036131198996
10-24 13:11:20 - INFO - Train metrics: 0.00020014452945673255 | Validation metrics: 0.00023328177963096572
10-24 13:11:20 - INFO - Train metrics: 0.00019912173088061107 | Validation metrics: 0.00023252818341874942
10-24 13:11:20 - INFO - Train metrics: 0.00019809408184843496 | Validation metrics: 0.00023177429190554628
10-24 13:11:20 - INFO - Train metrics: 0.0001970621465295693 | Validation metrics: 0.00023102346540786176
10-24 13:11:20 - INFO - Train metrics: 0.00019602918652245744 | Validation metrics: 0.00023028133257710836
10-24 13:11:20 - INFO - Train metrics: 0.0001949978667970182 | Validation metrics: 0.0002295532718893479
10-24 13:11:20 - INFO - Train metrics: 0.0001939708727469112 | Validation metrics: 0.00022884496726387302
10-24 13:11:20 - INFO - Train metrics: 0.00019295201613509416 | Validation metrics: 0.00022816381886403894
10-24 13:11:20 - INFO - Train metrics: 0.00019194575221823963 | Validation metrics: 0.00022751641312186051
10-24 13:11:20 - INFO - Train metrics: 0.00019095394874743202 | Validation metrics: 0.00022690783188951137
10-24 13:11:20 - INFO - Train metrics: 0.00018998022998839543 | Validation metrics: 0.00022634676956886782
10-24 13:11:20 - INFO - Train metrics: 0.00018903220757751033 | Validation metrics: 0.00022584557441542998
10-24 13:11:20 - INFO - Train metrics: 0.00018812059704914578 | Validation metrics: 0.00022541721086276488
10-24 13:11:20 - INFO - Train metrics: 0.00018725578358366545 | Validation metrics: 0.00022507036816813239
10-24 13:11:20 - INFO - Train metrics: 0.00018644342685490613 | Validation metrics: 0.0002248069424901835
10-24 13:11:20 - INFO - Train metrics: 0.00018568238440987405 | Validation metrics: 0.00022462290824000545
10-24 13:11:20 - INFO - Train metrics: 0.00018497256043934285 | Validation metrics: 0.00022452296642116223
10-24 13:11:20 - INFO - Train metrics: 0.00018433090245390877 | Validation metrics: 0.00022454191742446087
print(mean_squared_error(y_valid, yhat))

ee, ex, extras, lam = narx_net.residuals(x_valid, y_valid, yhat)
narx_net.plot_result(y_valid, yhat, ee, ex)
0.00023765524019037584
../_images/narx_neural_network_20_11.png

Note

If you built the net configuration before calling the NARXNN, you can just pass the model to the NARXNN as follows:

class NARX(nn.Module):
    def __init__(self):
        super().__init__()
        self.lin = nn.Linear(4, 10)
        self.lin2 = nn.Linear(10, 10)
        self.lin3 = nn.Linear(10, 1)
        self.tanh = nn.Tanh()

    def forward(self, xb):
        z = self.lin(xb)
        z = self.tanh(z)
        z = self.lin2(z)
        z = self.tanh(z)
        z = self.lin3(z)
        return z

narx_net2 = NARXNN(net=NARX(),
                   ylag=2,
                   xlag=2,
                   loss_func='mse_loss',
                   optimizer='Adam',
                   epochs=200,
                   verbose=True,
                   optim_params={'betas': (0.9, 0.999), 'eps': 1e-05} # optional parameters of the optimizer
)

narx_net2.fit(train_dl, valid_dl)
yhat = narx_net2.predict(x_valid, y_valid)

ee, ex, extras, lam = narx_net2.residuals(x_valid, y_valid, yhat)
narx_net2.plot_result(y_valid, yhat, ee, ex)
10-24 13:11:21 - INFO - Train metrics: 0.17840660974047237 | Validation metrics: 0.20712975676011558
10-24 13:11:21 - INFO - Train metrics: 0.035934985412242715 | Validation metrics: 0.040638373318043625
10-24 13:11:21 - INFO - Train metrics: 0.02026423336681268 | Validation metrics: 0.02162840546607369
10-24 13:11:21 - INFO - Train metrics: 0.00586070684263282 | Validation metrics: 0.006543761481427484
10-24 13:11:21 - INFO - Train metrics: 0.006659210272096004 | Validation metrics: 0.008439958622359266
10-24 13:11:21 - INFO - Train metrics: 0.002855182246638831 | Validation metrics: 0.003381007779013328
10-24 13:11:21 - INFO - Train metrics: 0.0025860285462302748 | Validation metrics: 0.002734864960810301
10-24 13:11:21 - INFO - Train metrics: 0.0018715397991650833 | Validation metrics: 0.002458080637616792
10-24 13:11:21 - INFO - Train metrics: 0.0016622954397754075 | Validation metrics: 0.002102674333134083
10-24 13:11:21 - INFO - Train metrics: 0.0015264996557956313 | Validation metrics: 0.0017398941410573744
10-24 13:11:21 - INFO - Train metrics: 0.0013980163928858918 | Validation metrics: 0.0017443015781052485
10-24 13:11:21 - INFO - Train metrics: 0.0013038875314262334 | Validation metrics: 0.0015986902719231867
10-24 13:11:21 - INFO - Train metrics: 0.0012463187513800623 | Validation metrics: 0.0014677469105920707
10-24 13:11:21 - INFO - Train metrics: 0.001185331801285169 | Validation metrics: 0.001429664401450392
10-24 13:11:21 - INFO - Train metrics: 0.001132535755769688 | Validation metrics: 0.0013479699293678306
10-24 13:11:21 - INFO - Train metrics: 0.0010874970615631376 | Validation metrics: 0.0012713023402605844
10-24 13:11:21 - INFO - Train metrics: 0.0010429982060652908 | Validation metrics: 0.001225984413082702
10-24 13:11:21 - INFO - Train metrics: 0.0010019505865064293 | Validation metrics: 0.0011613967268718313
10-24 13:11:21 - INFO - Train metrics: 0.0009636063302895124 | Validation metrics: 0.0011085999325256455
10-24 13:11:21 - INFO - Train metrics: 0.0009267588214888086 | Validation metrics: 0.0010601712374317675
10-24 13:11:21 - INFO - Train metrics: 0.0008917352847549551 | Validation metrics: 0.0010089858745535214
10-24 13:11:21 - INFO - Train metrics: 0.0008579818355351369 | Validation metrics: 0.0009641226432803604
10-24 13:11:21 - INFO - Train metrics: 0.0008257890245900548 | Validation metrics: 0.000918954283920954
10-24 13:11:21 - INFO - Train metrics: 0.0007949364831131932 | Validation metrics: 0.0008761283619366962
10-24 13:11:21 - INFO - Train metrics: 0.000765405666931558 | Validation metrics: 0.0008354794605625699
10-24 13:11:21 - INFO - Train metrics: 0.0007372061401911379 | Validation metrics: 0.0007959329193890697
10-24 13:11:21 - INFO - Train metrics: 0.000710400666068203 | Validation metrics: 0.0007587644110452572
10-24 13:11:21 - INFO - Train metrics: 0.0006850700887307562 | Validation metrics: 0.0007230153547204806
10-24 13:11:21 - INFO - Train metrics: 0.000661368308796601 | Validation metrics: 0.0006894554785274044
10-24 13:11:21 - INFO - Train metrics: 0.0006394291558900479 | Validation metrics: 0.0006578380789965241
10-24 13:11:21 - INFO - Train metrics: 0.0006194863679794301 | Validation metrics: 0.0006285205964384732
10-24 13:11:21 - INFO - Train metrics: 0.0006017530115086697 | Validation metrics: 0.0006016512493123159
10-24 13:11:21 - INFO - Train metrics: 0.0005865011503978312 | Validation metrics: 0.0005774672103180278
10-24 13:11:21 - INFO - Train metrics: 0.0005739699341041645 | Validation metrics: 0.0005562462658160413
10-24 13:11:21 - INFO - Train metrics: 0.0005643471667279295 | Validation metrics: 0.0005381532340319921
10-24 13:11:21 - INFO - Train metrics: 0.0005576982874660181 | Validation metrics: 0.0005233443084624455
10-24 13:11:21 - INFO - Train metrics: 0.0005538696450890885 | Validation metrics: 0.0005117285146490868
10-24 13:11:21 - INFO - Train metrics: 0.0005524026508324017 | Validation metrics: 0.0005030068833465604
10-24 13:11:21 - INFO - Train metrics: 0.0005524435875217259 | Validation metrics: 0.0004964998383498328
10-24 13:11:21 - INFO - Train metrics: 0.0005527101500884147 | Validation metrics: 0.0004911650580147074
10-24 13:11:21 - INFO - Train metrics: 0.0005515485456800391 | Validation metrics: 0.0004856063463405302
10-24 13:11:21 - INFO - Train metrics: 0.0005471238162267001 | Validation metrics: 0.00047825257507896034
10-24 13:11:21 - INFO - Train metrics: 0.0005377505498618485 | Validation metrics: 0.00046764406660157774
10-24 13:11:21 - INFO - Train metrics: 0.00052234526612168 | Validation metrics: 0.0004528297953345258
10-24 13:11:21 - INFO - Train metrics: 0.0005008230404665735 | Validation metrics: 0.00043371978222928715
10-24 13:11:21 - INFO - Train metrics: 0.0004743180138655334 | Validation metrics: 0.00041126724446634527
10-24 13:11:21 - INFO - Train metrics: 0.00044502615172971495 | Validation metrics: 0.0003873088997976873
10-24 13:11:21 - INFO - Train metrics: 0.00041567016634238153 | Validation metrics: 0.00036406841433625855
10-24 13:11:21 - INFO - Train metrics: 0.00038874453198594185 | Validation metrics: 0.00034347518183751915
10-24 13:11:22 - INFO - Train metrics: 0.00036586760442626937 | Validation metrics: 0.00032661236455720484
10-24 13:11:22 - INFO - Train metrics: 0.0003475194234829303 | Validation metrics: 0.00031354058930189397
10-24 13:11:22 - INFO - Train metrics: 0.0003332330983594284 | Validation metrics: 0.00030355355608267613
10-24 13:11:22 - INFO - Train metrics: 0.0003220616451920918 | Validation metrics: 0.0002956660996506348
10-24 13:11:22 - INFO - Train metrics: 0.00031302952273126766 | Validation metrics: 0.0002890352422554949
10-24 13:11:22 - INFO - Train metrics: 0.00030537672463558233 | Validation metrics: 0.00028314135705280783
10-24 13:11:22 - INFO - Train metrics: 0.0002986058845321291 | Validation metrics: 0.00027774343463460527
10-24 13:11:22 - INFO - Train metrics: 0.00029243633959542744 | Validation metrics: 0.00027274815136369205
10-24 13:11:22 - INFO - Train metrics: 0.0002867361095344139 | Validation metrics: 0.00026811050184099287
10-24 13:11:22 - INFO - Train metrics: 0.0002814456483496255 | Validation metrics: 0.00026377628326905195
10-24 13:11:22 - INFO - Train metrics: 0.0002765204872846146 | Validation metrics: 0.000259682064290356
10-24 13:11:22 - INFO - Train metrics: 0.00027191215343563293 | Validation metrics: 0.00025578554763195266
10-24 13:11:22 - INFO - Train metrics: 0.0002675748408747543 | Validation metrics: 0.0002520735924734235
10-24 13:11:22 - INFO - Train metrics: 0.00026347204125375443 | Validation metrics: 0.00024854216396554625
10-24 13:11:22 - INFO - Train metrics: 0.00025957610680900264 | Validation metrics: 0.00024517678809728513
10-24 13:11:22 - INFO - Train metrics: 0.0002558660452174756 | Validation metrics: 0.0002419541544643127
10-24 13:11:22 - INFO - Train metrics: 0.00025232314993744076 | Validation metrics: 0.0002388569942059353
10-24 13:11:22 - INFO - Train metrics: 0.0002489317722987958 | Validation metrics: 0.0002358776218530656
10-24 13:11:22 - INFO - Train metrics: 0.000245678863208916 | Validation metrics: 0.000233009131272521
10-24 13:11:22 - INFO - Train metrics: 0.0002425523774385018 | Validation metrics: 0.00023024229978380555
10-24 13:11:22 - INFO - Train metrics: 0.0002395415502538517 | Validation metrics: 0.00022756595357387055
10-24 13:11:22 - INFO - Train metrics: 0.00023663740246679241 | Validation metrics: 0.0002249748201457539
10-24 13:11:22 - INFO - Train metrics: 0.00023383174488673402 | Validation metrics: 0.00022246299847734696
10-24 13:11:22 - INFO - Train metrics: 0.0002311179325037652 | Validation metrics: 0.0002200251072997961
10-24 13:11:22 - INFO - Train metrics: 0.0002284889101190259 | Validation metrics: 0.00021765644472760307
10-24 13:11:22 - INFO - Train metrics: 0.0002259399258210102 | Validation metrics: 0.00021535302133115968
10-24 13:11:22 - INFO - Train metrics: 0.00022346524097624103 | Validation metrics: 0.00021311069481225328
10-24 13:11:22 - INFO - Train metrics: 0.0002210604556180294 | Validation metrics: 0.00021092673499640454
10-24 13:11:22 - INFO - Train metrics: 0.0002187214366742118 | Validation metrics: 0.00020879764795406826
10-24 13:11:22 - INFO - Train metrics: 0.00021644468832980458 | Validation metrics: 0.00020672251338684798
10-24 13:11:22 - INFO - Train metrics: 0.00021422639036058615 | Validation metrics: 0.00020469730805765574
10-24 13:11:22 - INFO - Train metrics: 0.00021206376156367054 | Validation metrics: 0.00020272077814995716
10-24 13:11:22 - INFO - Train metrics: 0.0002099541937544321 | Validation metrics: 0.00020079107263073738
10-24 13:11:22 - INFO - Train metrics: 0.00020789495000573703 | Validation metrics: 0.00019890678099314258
10-24 13:11:22 - INFO - Train metrics: 0.00020588391237567766 | Validation metrics: 0.00019706745345070205
10-24 13:11:22 - INFO - Train metrics: 0.00020391826734809265 | Validation metrics: 0.0001952695752014265
10-24 13:11:22 - INFO - Train metrics: 0.00020199706321313772 | Validation metrics: 0.00019351449589870607
10-24 13:11:22 - INFO - Train metrics: 0.00020011753277277765 | Validation metrics: 0.00019179942804233482
10-24 13:11:22 - INFO - Train metrics: 0.00019827903785805842 | Validation metrics: 0.00019012494018592993
10-24 13:11:22 - INFO - Train metrics: 0.0001964794124218689 | Validation metrics: 0.00018848952069417622
10-24 13:11:22 - INFO - Train metrics: 0.00019471740773482188 | Validation metrics: 0.00018689321601561112
10-24 13:11:22 - INFO - Train metrics: 0.00019299188247452346 | Validation metrics: 0.00018533449702322333
10-24 13:11:22 - INFO - Train metrics: 0.00019130194200819037 | Validation metrics: 0.0001838137258980141
10-24 13:11:22 - INFO - Train metrics: 0.00018964652514013984 | Validation metrics: 0.00018233172210389655
10-24 13:11:22 - INFO - Train metrics: 0.00018802404625867646 | Validation metrics: 0.00018088588790351882
10-24 13:11:22 - INFO - Train metrics: 0.00018643508747688035 | Validation metrics: 0.0001794784129926502
10-24 13:11:22 - INFO - Train metrics: 0.00018487811325769172 | Validation metrics: 0.00017810837927772992
10-24 13:11:22 - INFO - Train metrics: 0.0001833534338960849 | Validation metrics: 0.00017677696355303393
10-24 13:11:22 - INFO - Train metrics: 0.00018185998987404158 | Validation metrics: 0.00017548371147543116
10-24 13:11:22 - INFO - Train metrics: 0.00018039828861210458 | Validation metrics: 0.00017423000738772592
10-24 13:11:22 - INFO - Train metrics: 0.0001789681715709869 | Validation metrics: 0.00017301650921287335
10-24 13:11:22 - INFO - Train metrics: 0.00017757044884377394 | Validation metrics: 0.00017184492760935252
10-24 13:11:22 - INFO - Train metrics: 0.000176205145449548 | Validation metrics: 0.00017071689224467998
10-24 13:11:22 - INFO - Train metrics: 0.000174873718549264 | Validation metrics: 0.00016963382641375628
10-24 13:11:22 - INFO - Train metrics: 0.00017357691948128196 | Validation metrics: 0.0001685980663604263
10-24 13:11:22 - INFO - Train metrics: 0.00017231744961354432 | Validation metrics: 0.00016761387226811488
10-24 13:11:22 - INFO - Train metrics: 0.00017109636612992762 | Validation metrics: 0.00016668339370458265
10-24 13:11:22 - INFO - Train metrics: 0.0001699171110142704 | Validation metrics: 0.00016581131712147833
10-24 13:11:22 - INFO - Train metrics: 0.00016878267539633592 | Validation metrics: 0.00016500232118003147
10-24 13:11:22 - INFO - Train metrics: 0.00016769757915934767 | Validation metrics: 0.00016426308800212362
10-24 13:11:22 - INFO - Train metrics: 0.00016666715103960165 | Validation metrics: 0.00016360044155406267
10-24 13:11:22 - INFO - Train metrics: 0.00016569664311142436 | Validation metrics: 0.00016302201938650786
10-24 13:11:22 - INFO - Train metrics: 0.00016479506406800022 | Validation metrics: 0.00016253893460603337
10-24 13:11:22 - INFO - Train metrics: 0.0001639702685882237 | Validation metrics: 0.00016216165136258973
10-24 13:11:22 - INFO - Train metrics: 0.000163234621459994 | Validation metrics: 0.0001619051144731165
10-24 13:11:22 - INFO - Train metrics: 0.00016260077880128265 | Validation metrics: 0.00016178596030445676
10-24 13:11:22 - INFO - Train metrics: 0.0001620852763290146 | Validation metrics: 0.000161823222173773
10-24 13:11:22 - INFO - Train metrics: 0.00016170722873149707 | Validation metrics: 0.0001620396566306796
10-24 13:11:22 - INFO - Train metrics: 0.00016149015638966785 | Validation metrics: 0.0001624629440637437
10-24 13:11:22 - INFO - Train metrics: 0.00016146081965562553 | Validation metrics: 0.00016312335113373896
10-24 13:11:22 - INFO - Train metrics: 0.00016165097026133392 | Validation metrics: 0.00016405649607850595
10-24 13:11:22 - INFO - Train metrics: 0.0001620984150308014 | Validation metrics: 0.00016530391800151478
10-24 13:11:22 - INFO - Train metrics: 0.0001628437218954203 | Validation metrics: 0.0001669094369822003
10-24 13:11:22 - INFO - Train metrics: 0.00016393473678657128 | Validation metrics: 0.00016892379716584326
10-24 13:11:22 - INFO - Train metrics: 0.00016541963493198222 | Validation metrics: 0.00017139613551953148
10-24 13:11:23 - INFO - Train metrics: 0.00016735287517849544 | Validation metrics: 0.00017438266535684693
10-24 13:11:23 - INFO - Train metrics: 0.00016978422799386914 | Validation metrics: 0.0001779299805874494
10-24 13:11:23 - INFO - Train metrics: 0.0001727612293792193 | Validation metrics: 0.00018208309822254862
10-24 13:11:23 - INFO - Train metrics: 0.000176325335078651 | Validation metrics: 0.00018687757726340093
10-24 13:11:23 - INFO - Train metrics: 0.00018050988900059726 | Validation metrics: 0.00019233933687586374
10-24 13:11:23 - INFO - Train metrics: 0.00018533915188659523 | Validation metrics: 0.00019848317136009685
10-24 13:11:23 - INFO - Train metrics: 0.00019083425847878842 | Validation metrics: 0.00020532067241899746
10-24 13:11:23 - INFO - Train metrics: 0.00019701564170853154 | Validation metrics: 0.00021286121721854527
10-24 13:11:23 - INFO - Train metrics: 0.0002039140927719704 | Validation metrics: 0.00022112486550038813
10-24 13:11:23 - INFO - Train metrics: 0.00021158680886544876 | Validation metrics: 0.0002301607856872689
10-24 13:11:23 - INFO - Train metrics: 0.00022011655573919882 | Validation metrics: 0.000240042513457475
10-24 13:11:23 - INFO - Train metrics: 0.00022960388304270048 | Validation metrics: 0.00025086046603386
10-24 13:11:23 - INFO - Train metrics: 0.0002401602306557273 | Validation metrics: 0.0002627155356664173
10-24 13:11:23 - INFO - Train metrics: 0.00025187059686219266 | Validation metrics: 0.0002756753076230072
10-24 13:11:23 - INFO - Train metrics: 0.0002647312376986638 | Validation metrics: 0.00028971332505185423
10-24 13:11:23 - INFO - Train metrics: 0.0002785814967021617 | Validation metrics: 0.00030463708757488714
10-24 13:11:23 - INFO - Train metrics: 0.0002930188434254518 | Validation metrics: 0.0003200056689269276
10-24 13:11:23 - INFO - Train metrics: 0.00030732179588094393 | Validation metrics: 0.0003350535257733568
10-24 13:11:23 - INFO - Train metrics: 0.00032042132960142275 | Validation metrics: 0.00034866865161063167
10-24 13:11:23 - INFO - Train metrics: 0.0003309724955290864 | Validation metrics: 0.0003594690710400241
10-24 13:11:23 - INFO - Train metrics: 0.00033754964894790174 | Validation metrics: 0.00036600758256908093
10-24 13:11:23 - INFO - Train metrics: 0.0003389631664114339 | Validation metrics: 0.0003670914615433889
10-24 13:11:23 - INFO - Train metrics: 0.00033460410898563016 | Validation metrics: 0.00036213223821238963
10-24 13:11:23 - INFO - Train metrics: 0.00032470351162968775 | Validation metrics: 0.00035140970504297074
10-24 13:11:23 - INFO - Train metrics: 0.0003104047396221434 | Validation metrics: 0.0003361468332128204
10-24 13:11:23 - INFO - Train metrics: 0.00029353721619917447 | Validation metrics: 0.0003182859418118805
10-24 13:11:23 - INFO - Train metrics: 0.0002762044220929382 | Validation metrics: 0.0003000573188094704
10-24 13:11:23 - INFO - Train metrics: 0.0002602861770314928 | Validation metrics: 0.00028345459746432046
10-24 13:11:23 - INFO - Train metrics: 0.00024707723865699825 | Validation metrics: 0.0002698395971556881
10-24 13:11:23 - INFO - Train metrics: 0.0002371846076540467 | Validation metrics: 0.000259829611597451
10-24 13:11:23 - INFO - Train metrics: 0.00023064327506928524 | Validation metrics: 0.00025342335963311297
10-24 13:11:23 - INFO - Train metrics: 0.00022713137784871251 | Validation metrics: 0.0002502371093159485
10-24 13:11:23 - INFO - Train metrics: 0.00022617810256113962 | Validation metrics: 0.00024973671980945376
10-24 13:11:23 - INFO - Train metrics: 0.0002272916394770192 | Validation metrics: 0.00025137737005328137
10-24 13:11:23 - INFO - Train metrics: 0.00023001760321979722 | Validation metrics: 0.00025466562194674454
10-24 13:11:23 - INFO - Train metrics: 0.0002339497984113886 | Validation metrics: 0.00025916894523878443
10-24 13:11:23 - INFO - Train metrics: 0.000238722612011132 | Validation metrics: 0.00026450525543586625
10-24 13:11:23 - INFO - Train metrics: 0.00024400636020412944 | Validation metrics: 0.00027033429554042715
10-24 13:11:23 - INFO - Train metrics: 0.0002494785267778586 | Validation metrics: 0.000276323175645725
10-24 13:11:23 - INFO - Train metrics: 0.00025484074929199254 | Validation metrics: 0.000282167193345782
10-24 13:11:23 - INFO - Train metrics: 0.00025982152471344514 | Validation metrics: 0.0002875891952149833
10-24 13:11:23 - INFO - Train metrics: 0.000264178086175784 | Validation metrics: 0.00029234181456926344
10-24 13:11:23 - INFO - Train metrics: 0.0002677174868079061 | Validation metrics: 0.0002962316103006779
10-24 13:11:23 - INFO - Train metrics: 0.0002703024485827725 | Validation metrics: 0.00029912232474254614
10-24 13:11:23 - INFO - Train metrics: 0.0002718801907920757 | Validation metrics: 0.00030096624289977956
10-24 13:11:23 - INFO - Train metrics: 0.0002724644940995371 | Validation metrics: 0.00030178443065402333
10-24 13:11:23 - INFO - Train metrics: 0.00027215269838143515 | Validation metrics: 0.00030168483646426616
10-24 13:11:23 - INFO - Train metrics: 0.0002711005542817687 | Validation metrics: 0.00030083477237224205
10-24 13:11:23 - INFO - Train metrics: 0.00026950467473309123 | Validation metrics: 0.0002994422361047731
10-24 13:11:23 - INFO - Train metrics: 0.00026758204057157967 | Validation metrics: 0.0002977335984310643
10-24 13:11:23 - INFO - Train metrics: 0.00026553529571452384 | Validation metrics: 0.0002959195363942082
10-24 13:11:23 - INFO - Train metrics: 0.0002635400127027216 | Validation metrics: 0.0002941801882998058
10-24 13:11:23 - INFO - Train metrics: 0.0002617327937926924 | Validation metrics: 0.0002926526514159497
10-24 13:11:23 - INFO - Train metrics: 0.0002601999266263924 | Validation metrics: 0.0002914223404874028
10-24 13:11:23 - INFO - Train metrics: 0.0002589848236516958 | Validation metrics: 0.0002905285539166682
10-24 13:11:23 - INFO - Train metrics: 0.00025809333054436357 | Validation metrics: 0.00028997282803322027
10-24 13:11:23 - INFO - Train metrics: 0.0002575000270414528 | Validation metrics: 0.00028972509299461365
10-24 13:11:23 - INFO - Train metrics: 0.0002571610190959899 | Validation metrics: 0.00028973697000324273
10-24 13:11:23 - INFO - Train metrics: 0.000257022555543747 | Validation metrics: 0.0002899512735599972
10-24 13:11:23 - INFO - Train metrics: 0.00025702303670519465 | Validation metrics: 0.00029030299864267234
10-24 13:11:23 - INFO - Train metrics: 0.0002571089464714774 | Validation metrics: 0.0002907363873097406
10-24 13:11:23 - INFO - Train metrics: 0.0002572260801254405 | Validation metrics: 0.0002911955064087354
10-24 13:11:23 - INFO - Train metrics: 0.000257334771772081 | Validation metrics: 0.0002916395041569503
10-24 13:11:23 - INFO - Train metrics: 0.00025740598931933115 | Validation metrics: 0.0002920396130348584
10-24 13:11:23 - INFO - Train metrics: 0.0002574118897744821 | Validation metrics: 0.0002923657946556694
10-24 13:11:23 - INFO - Train metrics: 0.000257342218049104 | Validation metrics: 0.0002926080731670325
10-24 13:11:23 - INFO - Train metrics: 0.00025719081412418454 | Validation metrics: 0.00029275864639056076
10-24 13:11:23 - INFO - Train metrics: 0.00025695545640733224 | Validation metrics: 0.00029281514074719236
10-24 13:11:23 - INFO - Train metrics: 0.0002566488898597905 | Validation metrics: 0.00029279000356304224
10-24 13:11:23 - INFO - Train metrics: 0.00025627889034669744 | Validation metrics: 0.00029269063691232314
10-24 13:11:23 - INFO - Train metrics: 0.0002558612937071503 | Validation metrics: 0.0002925325140375832
10-24 13:11:23 - INFO - Train metrics: 0.00025540904031382564 | Validation metrics: 0.000292328866010513
10-24 13:11:24 - INFO - Train metrics: 0.00025493746949009654 | Validation metrics: 0.0002920955332522892
10-24 13:11:24 - INFO - Train metrics: 0.00025446232834120135 | Validation metrics: 0.0002918483432490529
10-24 13:11:24 - INFO - Train metrics: 0.0002539961618216087 | Validation metrics: 0.00029160047739019827
10-24 13:11:24 - INFO - Train metrics: 0.0002535544564515086 | Validation metrics: 0.0002913689146740268
../_images/narx_neural_network_22_2001.png