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: 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: 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: 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: 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: 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)
03-05 15:32:20 - INFO - Train metrics: 0.158500081875868 | Validation metrics: 0.15204523563987077
03-05 15:32:20 - INFO - Train metrics: 0.02290440334898786 | Validation metrics: 0.022254473332202797
03-05 15:32:20 - INFO - Train metrics: 0.0181103205322323 | Validation metrics: 0.018054702987123018
03-05 15:32:20 - INFO - Train metrics: 0.004258315417364726 | Validation metrics: 0.004328042456899026
03-05 15:32:20 - INFO - Train metrics: 0.006136122591476094 | Validation metrics: 0.006244097427098137
03-05 15:32:20 - INFO - Train metrics: 0.0020210025692008493 | Validation metrics: 0.0022563112575109258
03-05 15:32:20 - INFO - Train metrics: 0.002757198264808359 | Validation metrics: 0.0030287025388179706
03-05 15:32:20 - INFO - Train metrics: 0.0017172715505281637 | Validation metrics: 0.0019270943376621364
03-05 15:32:20 - INFO - Train metrics: 0.001730692492655588 | Validation metrics: 0.0019292553776235441
03-05 15:32:20 - INFO - Train metrics: 0.0016337691066333824 | Validation metrics: 0.001850063838487999
03-05 15:32:20 - INFO - Train metrics: 0.0015514155019443472 | Validation metrics: 0.0017667755889094838
03-05 15:32:20 - INFO - Train metrics: 0.0015171460059231012 | Validation metrics: 0.00172228478671362
03-05 15:32:20 - INFO - Train metrics: 0.0014941115019828977 | Validation metrics: 0.0016951040221340578
03-05 15:32:20 - INFO - Train metrics: 0.0014578429844935325 | Validation metrics: 0.0016557742721598709
03-05 15:32:20 - INFO - Train metrics: 0.0014306183214086974 | Validation metrics: 0.0016283725607067797
03-05 15:32:20 - INFO - Train metrics: 0.0014068609352146549 | Validation metrics: 0.0015985819045454264
03-05 15:32:20 - INFO - Train metrics: 0.0013788877388247684 | Validation metrics: 0.0015681489297856737
03-05 15:32:20 - INFO - Train metrics: 0.0013533661499115308 | Validation metrics: 0.0015399043631711693
03-05 15:32:20 - INFO - Train metrics: 0.0013285949131833356 | Validation metrics: 0.0015123347220283867
03-05 15:32:20 - INFO - Train metrics: 0.001303066279830173 | Validation metrics: 0.0014838082821701062
03-05 15:32:20 - INFO - Train metrics: 0.0012783440472418093 | Validation metrics: 0.0014565558786588636
03-05 15:32:20 - INFO - Train metrics: 0.0012534219464683965 | Validation metrics: 0.0014290722037637324
03-05 15:32:20 - INFO - Train metrics: 0.0012285929044269792 | Validation metrics: 0.0014018225906924768
03-05 15:32:20 - INFO - Train metrics: 0.0012038758892290538 | Validation metrics: 0.0013746359653658037
03-05 15:32:20 - INFO - Train metrics: 0.0011789402098775395 | Validation metrics: 0.0013474781157900438
03-05 15:32:20 - INFO - Train metrics: 0.001154012274041417 | Validation metrics: 0.001320307053663213
03-05 15:32:20 - INFO - Train metrics: 0.0011289360455090278 | Validation metrics: 0.0012931197169095728
03-05 15:32:20 - INFO - Train metrics: 0.0011035989996811427 | Validation metrics: 0.0012657290308105975
03-05 15:32:20 - INFO - Train metrics: 0.0010781188376999477 | Validation metrics: 0.0012383138363465968
03-05 15:32:20 - INFO - Train metrics: 0.0010523160570592883 | Validation metrics: 0.00121065238232
03-05 15:32:20 - INFO - Train metrics: 0.0010262486317141313 | Validation metrics: 0.0011828379820787696
03-05 15:32:20 - INFO - Train metrics: 0.000999844746540457 | Validation metrics: 0.0011547839309023035
03-05 15:32:20 - INFO - Train metrics: 0.0009731159765474068 | Validation metrics: 0.001126519551340754
03-05 15:32:20 - INFO - Train metrics: 0.0009460455625969216 | Validation metrics: 0.0010980322799466625
03-05 15:32:21 - INFO - Train metrics: 0.0009186413494477931 | Validation metrics: 0.0010693252187767865
03-05 15:32:21 - INFO - Train metrics: 0.0008909294179250908 | Validation metrics: 0.001040434620032708
03-05 15:32:21 - INFO - Train metrics: 0.0008629466306924689 | Validation metrics: 0.001011395224868649
03-05 15:32:21 - INFO - Train metrics: 0.0008347570377677437 | Validation metrics: 0.0009822692637416449
03-05 15:32:21 - INFO - Train metrics: 0.0008064392177425418 | Validation metrics: 0.000953131640503992
03-05 15:32:21 - INFO - Train metrics: 0.0007781036041168155 | Validation metrics: 0.0009240833007627063
03-05 15:32:21 - INFO - Train metrics: 0.0007498797408846629 | Validation metrics: 0.0008952419010150914
03-05 15:32:21 - INFO - Train metrics: 0.00072192458624375 | Validation metrics: 0.0008667487177217021
03-05 15:32:21 - INFO - Train metrics: 0.0006944161050843267 | Validation metrics: 0.0008387601360528156
03-05 15:32:21 - INFO - Train metrics: 0.0006675457717257933 | Validation metrics: 0.0008114404979895687
03-05 15:32:21 - INFO - Train metrics: 0.0006415108055399175 | Validation metrics: 0.0007849553990356549
03-05 15:32:21 - INFO - Train metrics: 0.0006164940140317462 | Validation metrics: 0.0007594476043566535
03-05 15:32:21 - INFO - Train metrics: 0.0005926454733277584 | Validation metrics: 0.0007350189409058805
03-05 15:32:21 - INFO - Train metrics: 0.0005700562775419806 | Validation metrics: 0.0007117001164582266
03-05 15:32:21 - INFO - Train metrics: 0.0005487312282958444 | Validation metrics: 0.0006894241187091202
03-05 15:32:21 - INFO - Train metrics: 0.0005285812360654704 | Validation metrics: 0.0006680130015475431
03-05 15:32:21 - INFO - Train metrics: 0.0005094340120099092 | Validation metrics: 0.0006471942549317398
03-05 15:32:21 - INFO - Train metrics: 0.0004910975340158588 | Validation metrics: 0.0006266698379991482
03-05 15:32:21 - INFO - Train metrics: 0.00047346731904021144 | Validation metrics: 0.0006062385327455521
03-05 15:32:21 - INFO - Train metrics: 0.00045665997752445965 | Validation metrics: 0.0005859550138032346
03-05 15:32:21 - INFO - Train metrics: 0.0004410964347402283 | Validation metrics: 0.000566243733199445
03-05 15:32:21 - INFO - Train metrics: 0.00042743615073473996 | Validation metrics: 0.0005478623277281947
03-05 15:32:21 - INFO - Train metrics: 0.0004163062216580978 | Validation metrics: 0.0005316473496607458
03-05 15:32:21 - INFO - Train metrics: 0.0004079050957347806 | Validation metrics: 0.000518103855699677
03-05 15:32:21 - INFO - Train metrics: 0.0004017203006097454 | Validation metrics: 0.0005070766054253761
03-05 15:32:21 - INFO - Train metrics: 0.00039663291989970383 | Validation metrics: 0.0004977738982151178
03-05 15:32:21 - INFO - Train metrics: 0.00039143227255216946 | Validation metrics: 0.0004891916921931423
03-05 15:32:21 - INFO - Train metrics: 0.00038542939927125523 | Validation metrics: 0.0004806587457271161
03-05 15:32:21 - INFO - Train metrics: 0.00037869690025498377 | Validation metrics: 0.0004720703626376097
03-05 15:32:21 - INFO - Train metrics: 0.00037178946373036555 | Validation metrics: 0.0004636795093032597
03-05 15:32:21 - INFO - Train metrics: 0.0003652518503817223 | Validation metrics: 0.00045573454282030163
03-05 15:32:21 - INFO - Train metrics: 0.0003593157986931755 | Validation metrics: 0.00044830253517085856
03-05 15:32:21 - INFO - Train metrics: 0.0003539001549311673 | Validation metrics: 0.00044130516677125915
03-05 15:32:21 - INFO - Train metrics: 0.00034877597888287407 | Validation metrics: 0.0004346218201769234
03-05 15:32:21 - INFO - Train metrics: 0.00034376963381340406 | Validation metrics: 0.0004281685572950113
03-05 15:32:21 - INFO - Train metrics: 0.00033886560920467205 | Validation metrics: 0.0004219315961389003
03-05 15:32:21 - INFO - Train metrics: 0.0003341482799059074 | Validation metrics: 0.0004159384280692485
03-05 15:32:21 - INFO - Train metrics: 0.00032966477202104504 | Validation metrics: 0.0004101970951505607
03-05 15:32:21 - INFO - Train metrics: 0.0003253811019773882 | Validation metrics: 0.0004046814783118816
03-05 15:32:21 - INFO - Train metrics: 0.0003212375815387087 | Validation metrics: 0.0003993510955949361
03-05 15:32:21 - INFO - Train metrics: 0.0003172169975763686 | Validation metrics: 0.0003941840000657572
03-05 15:32:21 - INFO - Train metrics: 0.0003133329317320306 | Validation metrics: 0.00038917394351411724
03-05 15:32:21 - INFO - Train metrics: 0.0003095873540213663 | Validation metrics: 0.0003843220007238966
03-05 15:32:21 - INFO - Train metrics: 0.0003059633974981422 | Validation metrics: 0.0003796196622054347
03-05 15:32:21 - INFO - Train metrics: 0.0003024506038941798 | Validation metrics: 0.00037505667341515575
03-05 15:32:21 - INFO - Train metrics: 0.000299046648623081 | Validation metrics: 0.0003706233551245973
03-05 15:32:21 - INFO - Train metrics: 0.0002957469495456843 | Validation metrics: 0.00036631396858755386
03-05 15:32:21 - INFO - Train metrics: 0.0002925449775568067 | Validation metrics: 0.000362123119600136
03-05 15:32:21 - INFO - Train metrics: 0.0002894368793530609 | Validation metrics: 0.0003580462126969125
03-05 15:32:21 - INFO - Train metrics: 0.0002864201456590796 | Validation metrics: 0.00035407930239799877
03-05 15:32:21 - INFO - Train metrics: 0.00028348932749379364 | Validation metrics: 0.00035021649708858496
03-05 15:32:21 - INFO - Train metrics: 0.00028064167582170853 | Validation metrics: 0.0003464540526637751
03-05 15:32:21 - INFO - Train metrics: 0.0002778743488981358 | Validation metrics: 0.0003427883387881924
03-05 15:32:22 - INFO - Train metrics: 0.00027518334877583896 | Validation metrics: 0.0003392154308543964
03-05 15:32:22 - INFO - Train metrics: 0.00027256666094456846 | Validation metrics: 0.00033573224326840254
03-05 15:32:22 - INFO - Train metrics: 0.0002700219452083531 | Validation metrics: 0.00033233509395469093
03-05 15:32:22 - INFO - Train metrics: 0.0002675460876761597 | Validation metrics: 0.0003290217072289023
03-05 15:32:22 - INFO - Train metrics: 0.00026513701774539395 | Validation metrics: 0.00032578835456697927
03-05 15:32:22 - INFO - Train metrics: 0.000262792585890292 | Validation metrics: 0.0003226328414225142
03-05 15:32:22 - INFO - Train metrics: 0.00026051040763913055 | Validation metrics: 0.00031955255580021804
03-05 15:32:22 - INFO - Train metrics: 0.00025828842748829484 | Validation metrics: 0.00031654442562909814
03-05 15:32:22 - INFO - Train metrics: 0.0002561244298995736 | Validation metrics: 0.0003136061114315508
03-05 15:32:22 - INFO - Train metrics: 0.00025401723824667845 | Validation metrics: 0.00031073537574036783
03-05 15:32:22 - INFO - Train metrics: 0.00025196391326155895 | Validation metrics: 0.00030793002371516345
03-05 15:32:22 - INFO - Train metrics: 0.0002499627920140729 | Validation metrics: 0.0003051868527586751
03-05 15:32:22 - INFO - Train metrics: 0.00024801224461677284 | Validation metrics: 0.0003025043712260973
03-05 15:32:22 - INFO - Train metrics: 0.00024611005429143464 | Validation metrics: 0.00029988026756774447
03-05 15:32:22 - INFO - Train metrics: 0.00024425401483641417 | Validation metrics: 0.00029731119396117977
03-05 15:32:22 - INFO - Train metrics: 0.00024244310127169753 | Validation metrics: 0.0002947965777370928
03-05 15:32:22 - INFO - Train metrics: 0.00024067474027890197 | Validation metrics: 0.0002923331119360007
03-05 15:32:22 - INFO - Train metrics: 0.00023894565815122374 | Validation metrics: 0.0002899182545293988
03-05 15:32:22 - INFO - Train metrics: 0.00023725599916780222 | Validation metrics: 0.0002875506879075082
03-05 15:32:22 - INFO - Train metrics: 0.00023560205678441526 | Validation metrics: 0.0002852271518533617
03-05 15:32:22 - INFO - Train metrics: 0.000233981082476162 | Validation metrics: 0.00028294524221417655
03-05 15:32:22 - INFO - Train metrics: 0.0002323918905719545 | Validation metrics: 0.0002807033847373054
03-05 15:32:22 - INFO - Train metrics: 0.00023083196260574224 | Validation metrics: 0.00027849859789700596
03-05 15:32:22 - INFO - Train metrics: 0.00022929768539897463 | Validation metrics: 0.00027632918014811975
03-05 15:32:22 - INFO - Train metrics: 0.00022778638599459127 | Validation metrics: 0.0002741908667505615
03-05 15:32:22 - INFO - Train metrics: 0.00022629568181735906 | Validation metrics: 0.0002720824468085975
03-05 15:32:22 - INFO - Train metrics: 0.00022482252987580172 | Validation metrics: 0.00027000134154646236
03-05 15:32:22 - INFO - Train metrics: 0.00022336317329576478 | Validation metrics: 0.00026794419858505893
03-05 15:32:22 - INFO - Train metrics: 0.00022191419726427886 | Validation metrics: 0.0002659088058862835
03-05 15:32:22 - INFO - Train metrics: 0.00022047363530335607 | Validation metrics: 0.00026389328419522504
03-05 15:32:22 - INFO - Train metrics: 0.000219037617260023 | Validation metrics: 0.00026189531035006346
03-05 15:32:22 - INFO - Train metrics: 0.00021760277715593315 | Validation metrics: 0.0002599127452192602
03-05 15:32:22 - INFO - Train metrics: 0.00021616591389797497 | Validation metrics: 0.00025794393400017246
03-05 15:32:22 - INFO - Train metrics: 0.00021472658159212444 | Validation metrics: 0.0002559893205997092
03-05 15:32:22 - INFO - Train metrics: 0.0002132816716356385 | Validation metrics: 0.0002540486507268265
03-05 15:32:22 - INFO - Train metrics: 0.00021183046766581307 | Validation metrics: 0.0002521224103272996
03-05 15:32:22 - INFO - Train metrics: 0.00021037325638090785 | Validation metrics: 0.0002502138321311448
03-05 15:32:22 - INFO - Train metrics: 0.00020891207647142246 | Validation metrics: 0.0002483258617987781
03-05 15:32:22 - INFO - Train metrics: 0.00020745064254166246 | Validation metrics: 0.00024646633957874857
03-05 15:32:22 - INFO - Train metrics: 0.0002059940785799236 | Validation metrics: 0.0002446434487920311
03-05 15:32:22 - INFO - Train metrics: 0.00020455100362359508 | Validation metrics: 0.00024286808529539467
03-05 15:32:22 - INFO - Train metrics: 0.0002031321107409311 | Validation metrics: 0.00024115387173933965
03-05 15:32:22 - INFO - Train metrics: 0.00020175068885762534 | Validation metrics: 0.0002395180881557271
03-05 15:32:22 - INFO - Train metrics: 0.0002004213609708179 | Validation metrics: 0.00023797807557687087
03-05 15:32:22 - INFO - Train metrics: 0.0001991630351243256 | Validation metrics: 0.00023655554310846697
03-05 15:32:22 - INFO - Train metrics: 0.00019799460750890145 | Validation metrics: 0.00023527262774131476
03-05 15:32:22 - INFO - Train metrics: 0.00019693535952163593 | Validation metrics: 0.00023414991279203218
03-05 15:32:22 - INFO - Train metrics: 0.00019600248084033613 | Validation metrics: 0.00023320609894157812
03-05 15:32:22 - INFO - Train metrics: 0.00019521164949423166 | Validation metrics: 0.00023245611131036034
03-05 15:32:22 - INFO - Train metrics: 0.00019457261876773817 | Validation metrics: 0.00023190797241334099
03-05 15:32:22 - INFO - Train metrics: 0.00019409030181050002 | Validation metrics: 0.00023156245247310384
03-05 15:32:22 - INFO - Train metrics: 0.0001937607343379819 | Validation metrics: 0.0002314062017978009
03-05 15:32:22 - INFO - Train metrics: 0.00019357221493267578 | Validation metrics: 0.0002314191280142169
03-05 15:32:22 - INFO - Train metrics: 0.0001935037972249749 | Validation metrics: 0.00023156766264671177
03-05 15:32:22 - INFO - Train metrics: 0.00019352583867179133 | Validation metrics: 0.00023180582487692284
03-05 15:32:22 - INFO - Train metrics: 0.00019360019666093744 | Validation metrics: 0.00023208047199237039
03-05 15:32:22 - INFO - Train metrics: 0.00019368698121979833 | Validation metrics: 0.0002323366337658066
03-05 15:32:22 - INFO - Train metrics: 0.0001937424692408156 | Validation metrics: 0.00023251904114125993
03-05 15:32:22 - INFO - Train metrics: 0.0001937275258827147 | Validation metrics: 0.0002325816962496387
03-05 15:32:22 - INFO - Train metrics: 0.00019360964242217218 | Validation metrics: 0.00023249012148807372
03-05 15:32:22 - INFO - Train metrics: 0.00019336420898109834 | Validation metrics: 0.0002322257414102705
03-05 15:32:22 - INFO - Train metrics: 0.00019298132117586748 | Validation metrics: 0.00023178796908898146
03-05 15:32:23 - INFO - Train metrics: 0.00019246488001388977 | Validation metrics: 0.0002311951330289094
03-05 15:32:23 - INFO - Train metrics: 0.00019183214235249068 | Validation metrics: 0.0002304808435975715
03-05 15:32:23 - INFO - Train metrics: 0.00019111155434120634 | Validation metrics: 0.00022969012530261857
03-05 15:32:23 - INFO - Train metrics: 0.00019033893874705182 | Validation metrics: 0.0002288722726833922
03-05 15:32:23 - INFO - Train metrics: 0.000189552446388182 | Validation metrics: 0.00022807712619653855
03-05 15:32:23 - INFO - Train metrics: 0.00018879129609850498 | Validation metrics: 0.00022735266188968613
03-05 15:32:23 - INFO - Train metrics: 0.00018809079111613248 | Validation metrics: 0.0002267378217169093
03-05 15:32:23 - INFO - Train metrics: 0.00018747907644983867 | Validation metrics: 0.00022626240550178208
03-05 15:32:23 - INFO - Train metrics: 0.00018697674251260717 | Validation metrics: 0.00022594389303427453
03-05 15:32:23 - INFO - Train metrics: 0.0001865947673568166 | Validation metrics: 0.000225787953534775
03-05 15:32:23 - INFO - Train metrics: 0.00018633684556421248 | Validation metrics: 0.00022579118450092285
03-05 15:32:23 - INFO - Train metrics: 0.00018619803962254556 | Validation metrics: 0.00022593930447732823
03-05 15:32:23 - INFO - Train metrics: 0.00018616765806828405 | Validation metrics: 0.00022621229561422057
03-05 15:32:23 - INFO - Train metrics: 0.00018622870163853165 | Validation metrics: 0.00022658391816264038
03-05 15:32:23 - INFO - Train metrics: 0.00018636309645339417 | Validation metrics: 0.00022702782933430916
03-05 15:32:23 - INFO - Train metrics: 0.00018655144725342684 | Validation metrics: 0.00022751735576259142
03-05 15:32:23 - INFO - Train metrics: 0.00018677552679832558 | Validation metrics: 0.00022802861834255358
03-05 15:32:23 - INFO - Train metrics: 0.00018701937386181373 | Validation metrics: 0.00022854271457728112
03-05 15:32:23 - INFO - Train metrics: 0.00018726905985393406 | Validation metrics: 0.000229042722500221
03-05 15:32:23 - INFO - Train metrics: 0.0001875169146024064 | Validation metrics: 0.00022952205200463233
03-05 15:32:23 - INFO - Train metrics: 0.0001877570009987596 | Validation metrics: 0.00022997430024781462
03-05 15:32:23 - INFO - Train metrics: 0.00018798864852429315 | Validation metrics: 0.0002304027666928096
03-05 15:32:23 - INFO - Train metrics: 0.00018821137970112694 | Validation metrics: 0.00023080735270996963
03-05 15:32:23 - INFO - Train metrics: 0.00018842802587972445 | Validation metrics: 0.0002311943259120759
03-05 15:32:23 - INFO - Train metrics: 0.00018864153584705802 | Validation metrics: 0.00023156916002408986
03-05 15:32:23 - INFO - Train metrics: 0.0001888562422444143 | Validation metrics: 0.00023193744665618533
03-05 15:32:23 - INFO - Train metrics: 0.00018907490479328057 | Validation metrics: 0.00023230422429876835
03-05 15:32:23 - INFO - Train metrics: 0.0001893010533725222 | Validation metrics: 0.00023267419351443572
03-05 15:32:23 - INFO - Train metrics: 0.0001895370115838212 | Validation metrics: 0.00023305074445846859
03-05 15:32:23 - INFO - Train metrics: 0.00018978498048641553 | Validation metrics: 0.00023343678207531798
03-05 15:32:23 - INFO - Train metrics: 0.00019004631118369253 | Validation metrics: 0.00023383371716581585
03-05 15:32:23 - INFO - Train metrics: 0.00019032350051442025 | Validation metrics: 0.00023424470661363253
03-05 15:32:23 - INFO - Train metrics: 0.00019061356354889956 | Validation metrics: 0.00023466589357327633
03-05 15:32:23 - INFO - Train metrics: 0.0001909151542896783 | Validation metrics: 0.00023509482891331755
03-05 15:32:23 - INFO - Train metrics: 0.0001912272985243264 | Validation metrics: 0.00023553116573961545
03-05 15:32:23 - INFO - Train metrics: 0.00019155025581670527 | Validation metrics: 0.00023597437650849573
03-05 15:32:23 - INFO - Train metrics: 0.00019188180501207493 | Validation metrics: 0.00023642222037200224
03-05 15:32:23 - INFO - Train metrics: 0.0001922197679184928 | Validation metrics: 0.0002368712933578839
03-05 15:32:23 - INFO - Train metrics: 0.00019256388807212957 | Validation metrics: 0.00023732151109443018
03-05 15:32:23 - INFO - Train metrics: 0.0001929112059270781 | Validation metrics: 0.00023776951385309187
03-05 15:32:23 - INFO - Train metrics: 0.00019325876434451498 | Validation metrics: 0.00023821139495909177
03-05 15:32:23 - INFO - Train metrics: 0.00019360818351061085 | Validation metrics: 0.00023864980388992475
03-05 15:32:23 - INFO - Train metrics: 0.0001939562264448242 | Validation metrics: 0.00023908000113089767
03-05 15:32:23 - INFO - Train metrics: 0.00019430438371551432 | Validation metrics: 0.00023950427280259177
03-05 15:32:23 - INFO - Train metrics: 0.0001946514703080707 | Validation metrics: 0.00023992129335781992
03-05 15:32:23 - INFO - Train metrics: 0.00019499458054420224 | Validation metrics: 0.00024032786651984837
03-05 15:32:23 - INFO - Train metrics: 0.0001953322657606889 | Validation metrics: 0.0002407218490414453
03-05 15:32:23 - INFO - Train metrics: 0.00019566497203390952 | Validation metrics: 0.00024110414725704815
03-05 15:32:23 - INFO - Train metrics: 0.00019598822419404432 | Validation metrics: 0.0002414691423635102
03-05 15:32:23 - INFO - Train metrics: 0.00019630277514770476 | Validation metrics: 0.000241817507276669
03-05 15:32:23 - INFO - Train metrics: 0.0001966059279399352 | Validation metrics: 0.00024214702892949748
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.00027869169132727577
../_images/narx_neural_network_20_1.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)
03-05 15:32:24 - INFO - Train metrics: 0.0454738918682537 | Validation metrics: 0.04410000051362346
03-05 15:32:24 - INFO - Train metrics: 0.020950881176088985 | Validation metrics: 0.02067970608671506
03-05 15:32:24 - INFO - Train metrics: 0.0025225296741430846 | Validation metrics: 0.0027480544287222203
03-05 15:32:24 - INFO - Train metrics: 0.00680420057553994 | Validation metrics: 0.0066205651094817155
03-05 15:32:24 - INFO - Train metrics: 0.001765396029345299 | Validation metrics: 0.001954676093053863
03-05 15:32:24 - INFO - Train metrics: 0.0021925827518647027 | Validation metrics: 0.002383223245616513
03-05 15:32:24 - INFO - Train metrics: 0.0017717007820711548 | Validation metrics: 0.0018883601637707666
03-05 15:32:24 - INFO - Train metrics: 0.0014675815538958386 | Validation metrics: 0.0016673095583106684
03-05 15:32:24 - INFO - Train metrics: 0.0014614990686549617 | Validation metrics: 0.0016348152421414852
03-05 15:32:24 - INFO - Train metrics: 0.0013583956795737596 | Validation metrics: 0.0015054580313388747
03-05 15:32:24 - INFO - Train metrics: 0.0013048009150999978 | Validation metrics: 0.0014814316151626032
03-05 15:32:24 - INFO - Train metrics: 0.0012754034571919152 | Validation metrics: 0.0014442521279132126
03-05 15:32:24 - INFO - Train metrics: 0.0012122241938883498 | Validation metrics: 0.0013733406814586634
03-05 15:32:24 - INFO - Train metrics: 0.0011740662875284154 | Validation metrics: 0.0013335020213171539
03-05 15:32:24 - INFO - Train metrics: 0.0011272236385632464 | Validation metrics: 0.0012828024348827325
03-05 15:32:24 - INFO - Train metrics: 0.0010862609731584303 | Validation metrics: 0.0012413990951961641
03-05 15:32:24 - INFO - Train metrics: 0.001045177293734807 | Validation metrics: 0.0011991708341873054
03-05 15:32:24 - INFO - Train metrics: 0.0010004072226315532 | Validation metrics: 0.0011525373974100056
03-05 15:32:24 - INFO - Train metrics: 0.0009576767853129758 | Validation metrics: 0.0011086336976726247
03-05 15:32:24 - INFO - Train metrics: 0.0009117568752618698 | Validation metrics: 0.0010606266471152805
03-05 15:32:24 - INFO - Train metrics: 0.0008677456715846794 | Validation metrics: 0.0010148794601925395
03-05 15:32:24 - INFO - Train metrics: 0.0008232603306219188 | Validation metrics: 0.0009678242436487867
03-05 15:32:24 - INFO - Train metrics: 0.0007810843778764806 | Validation metrics: 0.000922742908270183
03-05 15:32:24 - INFO - Train metrics: 0.0007438759510883861 | Validation metrics: 0.0008817697114386417
03-05 15:32:24 - INFO - Train metrics: 0.0007134954412094315 | Validation metrics: 0.0008471555763272324
03-05 15:32:24 - INFO - Train metrics: 0.0006919663347231509 | Validation metrics: 0.00082117099329039
03-05 15:32:24 - INFO - Train metrics: 0.0006767067236050888 | Validation metrics: 0.0008019920046949251
03-05 15:32:24 - INFO - Train metrics: 0.0006617246806052021 | Validation metrics: 0.0007843181850727309
03-05 15:32:24 - INFO - Train metrics: 0.0006404501917879365 | Validation metrics: 0.0007621495657591055
03-05 15:32:24 - INFO - Train metrics: 0.0006117235584987472 | Validation metrics: 0.0007342597936524661
03-05 15:32:24 - INFO - Train metrics: 0.0005807119971934828 | Validation metrics: 0.0007050138048009213
03-05 15:32:24 - INFO - Train metrics: 0.0005542996259555594 | Validation metrics: 0.0006800033681263977
03-05 15:32:24 - INFO - Train metrics: 0.00053531589044286 | Validation metrics: 0.0006610420726550122
03-05 15:32:24 - INFO - Train metrics: 0.0005219600410381551 | Validation metrics: 0.0006463971721582265
03-05 15:32:24 - INFO - Train metrics: 0.0005101645023989162 | Validation metrics: 0.0006329374407850808
03-05 15:32:24 - INFO - Train metrics: 0.0004976112202228862 | Validation metrics: 0.0006189897469470673
03-05 15:32:24 - INFO - Train metrics: 0.0004855317560655945 | Validation metrics: 0.0006055075115514825
03-05 15:32:24 - INFO - Train metrics: 0.0004754083557579582 | Validation metrics: 0.0005935184161338691
03-05 15:32:24 - INFO - Train metrics: 0.00046642114725465743 | Validation metrics: 0.0005823850080210979
03-05 15:32:24 - INFO - Train metrics: 0.000457456802326677 | Validation metrics: 0.000571323476962256
03-05 15:32:24 - INFO - Train metrics: 0.00044888177277394253 | Validation metrics: 0.0005606043333601621
03-05 15:32:24 - INFO - Train metrics: 0.0004409844164309421 | Validation metrics: 0.0005504361564302911
03-05 15:32:24 - INFO - Train metrics: 0.0004333457184481647 | Validation metrics: 0.0005405363685573743
03-05 15:32:24 - INFO - Train metrics: 0.00042600595021158235 | Validation metrics: 0.0005309348096929942
03-05 15:32:24 - INFO - Train metrics: 0.00041908630627128095 | Validation metrics: 0.0005217305957245631
03-05 15:32:24 - INFO - Train metrics: 0.000412415706871759 | Validation metrics: 0.0005128139164298773
03-05 15:32:24 - INFO - Train metrics: 0.0004060388170562003 | Validation metrics: 0.0005041980990114612
03-05 15:32:24 - INFO - Train metrics: 0.0003999507472352043 | Validation metrics: 0.0004958945042524261
03-05 15:32:24 - INFO - Train metrics: 0.00039410678772512533 | Validation metrics: 0.000487872534325685
03-05 15:32:24 - INFO - Train metrics: 0.0003885274110647866 | Validation metrics: 0.0004801344425732627
03-05 15:32:24 - INFO - Train metrics: 0.0003831810498829548 | Validation metrics: 0.0004726641672084842
03-05 15:32:24 - INFO - Train metrics: 0.00037807086125228617 | Validation metrics: 0.00046545761282264133
03-05 15:32:24 - INFO - Train metrics: 0.0003731807881008068 | Validation metrics: 0.0004585011996860343
03-05 15:32:24 - INFO - Train metrics: 0.0003685055073452203 | Validation metrics: 0.00045178744811423576
03-05 15:32:24 - INFO - Train metrics: 0.00036403452752876964 | Validation metrics: 0.0004453055397137021
03-05 15:32:24 - INFO - Train metrics: 0.00035976179359588107 | Validation metrics: 0.0004390481212105828
03-05 15:32:24 - INFO - Train metrics: 0.0003556790049006943 | Validation metrics: 0.00043300547045561476
03-05 15:32:25 - INFO - Train metrics: 0.0003517803109168101 | Validation metrics: 0.00042717045377657723
03-05 15:32:25 - INFO - Train metrics: 0.00034805714074851373 | Validation metrics: 0.00042153425094897324
03-05 15:32:25 - INFO - Train metrics: 0.00034450661041773856 | Validation metrics: 0.000416090210130664
03-05 15:32:25 - INFO - Train metrics: 0.00034112002203686814 | Validation metrics: 0.00041083051091662107
03-05 15:32:25 - INFO - Train metrics: 0.00033789244823258154 | Validation metrics: 0.0004057475807253422
03-05 15:32:25 - INFO - Train metrics: 0.00033481859327480663 | Validation metrics: 0.00040083449313915666
03-05 15:32:25 - INFO - Train metrics: 0.0003318913664784338 | Validation metrics: 0.0003960841826887594
03-05 15:32:25 - INFO - Train metrics: 0.0003291063634637874 | Validation metrics: 0.00039148917204154786
03-05 15:32:25 - INFO - Train metrics: 0.00032645518183101315 | Validation metrics: 0.0003870420153205744
03-05 15:32:25 - INFO - Train metrics: 0.00032393075868587725 | Validation metrics: 0.0003827339043544436
03-05 15:32:25 - INFO - Train metrics: 0.00032152420153169146 | Validation metrics: 0.00037855668125128504
03-05 15:32:25 - INFO - Train metrics: 0.0003192232245401967 | Validation metrics: 0.00037449898023036017
03-05 15:32:25 - INFO - Train metrics: 0.0003170124906492198 | Validation metrics: 0.0003705480417608274
03-05 15:32:25 - INFO - Train metrics: 0.00031487380070109995 | Validation metrics: 0.0003666887906464663
03-05 15:32:25 - INFO - Train metrics: 0.00031277989009616985 | Validation metrics: 0.00036290138865811654
03-05 15:32:25 - INFO - Train metrics: 0.0003106938419749209 | Validation metrics: 0.00035915957737921015
03-05 15:32:25 - INFO - Train metrics: 0.0003085674256008156 | Validation metrics: 0.00035542898930167083
03-05 15:32:25 - INFO - Train metrics: 0.000306339499515535 | Validation metrics: 0.0003516686427044786
03-05 15:32:25 - INFO - Train metrics: 0.0003039303057293704 | Validation metrics: 0.0003478264937652369
03-05 15:32:25 - INFO - Train metrics: 0.0003012463517976052 | Validation metrics: 0.00034384340114863306
03-05 15:32:25 - INFO - Train metrics: 0.00029818010490205617 | Validation metrics: 0.000339656608764816
03-05 15:32:25 - INFO - Train metrics: 0.00029462870379050906 | Validation metrics: 0.0003352125981973127
03-05 15:32:25 - INFO - Train metrics: 0.00029051463453176157 | Validation metrics: 0.0003304889897764143
03-05 15:32:25 - INFO - Train metrics: 0.00028582117380224225 | Validation metrics: 0.00032552136660958026
03-05 15:32:25 - INFO - Train metrics: 0.00028062880616623413 | Validation metrics: 0.00032043309748229205
03-05 15:32:25 - INFO - Train metrics: 0.00027515073446907046 | Validation metrics: 0.0003154566987756301
03-05 15:32:25 - INFO - Train metrics: 0.0002697281906921603 | Validation metrics: 0.0003109207162821684
03-05 15:32:25 - INFO - Train metrics: 0.00026477842784561404 | Validation metrics: 0.0003071913673222592
03-05 15:32:25 - INFO - Train metrics: 0.0002606913220093009 | Validation metrics: 0.0003045683998892065
03-05 15:32:25 - INFO - Train metrics: 0.0002577051231205781 | Validation metrics: 0.00030317602354581607
03-05 15:32:25 - INFO - Train metrics: 0.00025582095156750527 | Validation metrics: 0.00030289512248756834
03-05 15:32:25 - INFO - Train metrics: 0.0002548109121763038 | Validation metrics: 0.0003033933018668169
03-05 15:32:25 - INFO - Train metrics: 0.0002543037713658214 | Validation metrics: 0.0003042262314461322
03-05 15:32:25 - INFO - Train metrics: 0.0002539092487390655 | Validation metrics: 0.000304968754532794
03-05 15:32:25 - INFO - Train metrics: 0.0002533167800200837 | Validation metrics: 0.000305305542882927
03-05 15:32:25 - INFO - Train metrics: 0.000252334707440519 | Validation metrics: 0.0003050561107088332
03-05 15:32:25 - INFO - Train metrics: 0.00025087951044703747 | Validation metrics: 0.0003041507187652204
03-05 15:32:25 - INFO - Train metrics: 0.0002489421221387939 | Validation metrics: 0.000302581101858217
03-05 15:32:25 - INFO - Train metrics: 0.0002465512803236354 | Validation metrics: 0.0003003612207131216
03-05 15:32:25 - INFO - Train metrics: 0.00024376173240668315 | Validation metrics: 0.00029752045491183494
03-05 15:32:25 - INFO - Train metrics: 0.00024066296734183066 | Validation metrics: 0.00029412624831875843
03-05 15:32:25 - INFO - Train metrics: 0.00023738880953804022 | Validation metrics: 0.00029030966724156207
03-05 15:32:25 - INFO - Train metrics: 0.00023410618383254165 | Validation metrics: 0.00028626527754834505
03-05 15:32:25 - INFO - Train metrics: 0.00023098341740765855 | Validation metrics: 0.0002822197755890419
03-05 15:32:25 - INFO - Train metrics: 0.00022814730478434316 | Validation metrics: 0.00027836943127572384
03-05 15:32:25 - INFO - Train metrics: 0.0002256535339174456 | Validation metrics: 0.00027482807380500054
03-05 15:32:25 - INFO - Train metrics: 0.00022349743477277748 | Validation metrics: 0.00027162366607837906
03-05 15:32:25 - INFO - Train metrics: 0.0002216396487961619 | Validation metrics: 0.00026872926353444014
03-05 15:32:25 - INFO - Train metrics: 0.00022003569278864887 | Validation metrics: 0.0002661055380788942
03-05 15:32:25 - INFO - Train metrics: 0.00021864356215457365 | Validation metrics: 0.00026371611359839636
03-05 15:32:25 - INFO - Train metrics: 0.00021742702984626878 | Validation metrics: 0.0002615307892832642
03-05 15:32:25 - INFO - Train metrics: 0.00021635222750281761 | Validation metrics: 0.00025951543221993355
03-05 15:32:25 - INFO - Train metrics: 0.00021538650894182778 | Validation metrics: 0.0002576389655440274
03-05 15:32:25 - INFO - Train metrics: 0.00021450881652077683 | Validation metrics: 0.0002558828362985749
03-05 15:32:25 - INFO - Train metrics: 0.0002137044781526051 | Validation metrics: 0.0002542334700454817
03-05 15:32:25 - INFO - Train metrics: 0.00021296190938219092 | Validation metrics: 0.0002526763425034593
03-05 15:32:25 - INFO - Train metrics: 0.00021226960613642047 | Validation metrics: 0.00025119701655572184
03-05 15:32:25 - INFO - Train metrics: 0.00021161909741355354 | Validation metrics: 0.0002497852691143488
03-05 15:32:25 - INFO - Train metrics: 0.00021100556353903036 | Validation metrics: 0.0002484318478070576
03-05 15:32:25 - INFO - Train metrics: 0.00021042512746686514 | Validation metrics: 0.0002471291921054474
03-05 15:32:25 - INFO - Train metrics: 0.0002098734774901053 | Validation metrics: 0.0002458711902051223
03-05 15:32:25 - INFO - Train metrics: 0.00020934723978914684 | Validation metrics: 0.00024465164798782255
03-05 15:32:25 - INFO - Train metrics: 0.0002088446697388848 | Validation metrics: 0.00024346728759789556
03-05 15:32:25 - INFO - Train metrics: 0.00020836326280517742 | Validation metrics: 0.0002423141401841992
03-05 15:32:25 - INFO - Train metrics: 0.00020790217844168316 | Validation metrics: 0.00024118878031408208
03-05 15:32:25 - INFO - Train metrics: 0.0002074578856754077 | Validation metrics: 0.00024008843974290283
03-05 15:32:25 - INFO - Train metrics: 0.00020702952721983632 | Validation metrics: 0.0002390103828575876
03-05 15:32:26 - INFO - Train metrics: 0.00020661514899710935 | Validation metrics: 0.00023795370714541411
03-05 15:32:26 - INFO - Train metrics: 0.00020621390816321443 | Validation metrics: 0.00023691651512483002
03-05 15:32:26 - INFO - Train metrics: 0.0002058227439288442 | Validation metrics: 0.00023589609631788775
03-05 15:32:26 - INFO - Train metrics: 0.00020543989981583 | Validation metrics: 0.0002348913259644325
03-05 15:32:26 - INFO - Train metrics: 0.00020506544526489008 | Validation metrics: 0.00023390021515572727
03-05 15:32:26 - INFO - Train metrics: 0.0002046946556812717 | Validation metrics: 0.00023292220930211396
03-05 15:32:26 - INFO - Train metrics: 0.00020433160275650354 | Validation metrics: 0.00023195725181281114
03-05 15:32:26 - INFO - Train metrics: 0.00020396899722106894 | Validation metrics: 0.00023100231074483482
03-05 15:32:26 - INFO - Train metrics: 0.00020360845944349348 | Validation metrics: 0.0002300568659039628
03-05 15:32:26 - INFO - Train metrics: 0.0002032475181511559 | Validation metrics: 0.00022912019572098448
03-05 15:32:26 - INFO - Train metrics: 0.00020288482585129443 | Validation metrics: 0.00022819016664994484
03-05 15:32:26 - INFO - Train metrics: 0.00020251913950399247 | Validation metrics: 0.0002272668026500579
03-05 15:32:26 - INFO - Train metrics: 0.0002021479478644506 | Validation metrics: 0.00022634777247510624
03-05 15:32:26 - INFO - Train metrics: 0.00020177103805164327 | Validation metrics: 0.00022543291840584705
03-05 15:32:26 - INFO - Train metrics: 0.00020138775752705609 | Validation metrics: 0.0002245220780193881
03-05 15:32:26 - INFO - Train metrics: 0.00020099622398768937 | Validation metrics: 0.0002236140598225492
03-05 15:32:26 - INFO - Train metrics: 0.00020059546457053883 | Validation metrics: 0.00022270784268245064
03-05 15:32:26 - INFO - Train metrics: 0.0002001842711748728 | Validation metrics: 0.00022180291610614708
03-05 15:32:26 - INFO - Train metrics: 0.00019976326336945292 | Validation metrics: 0.00022089903447494814
03-05 15:32:26 - INFO - Train metrics: 0.0001993294287254721 | Validation metrics: 0.00021999511933024746
03-05 15:32:26 - INFO - Train metrics: 0.00019888541248205694 | Validation metrics: 0.00021909149757567606
03-05 15:32:26 - INFO - Train metrics: 0.00019842683644568488 | Validation metrics: 0.00021818644003213542
03-05 15:32:26 - INFO - Train metrics: 0.00019795703169198843 | Validation metrics: 0.00021728167249797608
03-05 15:32:26 - INFO - Train metrics: 0.0001974743635922946 | Validation metrics: 0.00021637660393025726
03-05 15:32:26 - INFO - Train metrics: 0.00019697908649511664 | Validation metrics: 0.00021547039634444646
03-05 15:32:26 - INFO - Train metrics: 0.0001964709120245305 | Validation metrics: 0.0002145635931590346
03-05 15:32:26 - INFO - Train metrics: 0.00019594887380936372 | Validation metrics: 0.00021365538475837445
03-05 15:32:26 - INFO - Train metrics: 0.00019541459779819954 | Validation metrics: 0.00021274591622065113
03-05 15:32:26 - INFO - Train metrics: 0.00019486716911686877 | Validation metrics: 0.00021183546079849504
03-05 15:32:26 - INFO - Train metrics: 0.00019430798474923336 | Validation metrics: 0.00021092416107127763
03-05 15:32:26 - INFO - Train metrics: 0.0001937348731410664 | Validation metrics: 0.00021001148655554373
03-05 15:32:26 - INFO - Train metrics: 0.00019314964277813336 | Validation metrics: 0.00020909818880626875
03-05 15:32:26 - INFO - Train metrics: 0.00019255480103931135 | Validation metrics: 0.00020818485210489745
03-05 15:32:26 - INFO - Train metrics: 0.00019194670093746478 | Validation metrics: 0.00020727050676471506
03-05 15:32:26 - INFO - Train metrics: 0.00019132792983229802 | Validation metrics: 0.00020635648685827325
03-05 15:32:26 - INFO - Train metrics: 0.00019070053834031642 | Validation metrics: 0.00020544250311113594
03-05 15:32:26 - INFO - Train metrics: 0.00019006034630534 | Validation metrics: 0.00020452792920299214
03-05 15:32:26 - INFO - Train metrics: 0.0001894116599636764 | Validation metrics: 0.00020361386960950878
03-05 15:32:26 - INFO - Train metrics: 0.00018875185067048834 | Validation metrics: 0.00020269968669221858
03-05 15:32:26 - INFO - Train metrics: 0.0001880833838265716 | Validation metrics: 0.00020178551494609565
03-05 15:32:26 - INFO - Train metrics: 0.00018740463760456207 | Validation metrics: 0.00020087139391119244
03-05 15:32:26 - INFO - Train metrics: 0.0001867170184343017 | Validation metrics: 0.00019995790316530438
03-05 15:32:26 - INFO - Train metrics: 0.00018602288379899941 | Validation metrics: 0.00019904558891971417
03-05 15:32:26 - INFO - Train metrics: 0.00018531932561328043 | Validation metrics: 0.0001981339944794661
03-05 15:32:26 - INFO - Train metrics: 0.0001846077724448627 | Validation metrics: 0.0001972238018737184
03-05 15:32:26 - INFO - Train metrics: 0.0001838903646288267 | Validation metrics: 0.00019631481722392368
03-05 15:32:26 - INFO - Train metrics: 0.00018316390825684104 | Validation metrics: 0.00019540622459390586
03-05 15:32:26 - INFO - Train metrics: 0.00018242970898947014 | Validation metrics: 0.00019449867734995982
03-05 15:32:26 - INFO - Train metrics: 0.00018169057727931417 | Validation metrics: 0.0001935927643301906
03-05 15:32:26 - INFO - Train metrics: 0.00018094215167302377 | Validation metrics: 0.00019268717409835922
03-05 15:32:26 - INFO - Train metrics: 0.00018018913313216602 | Validation metrics: 0.00019178424774894887
03-05 15:32:26 - INFO - Train metrics: 0.0001794307380780475 | Validation metrics: 0.00019088274337153769
03-05 15:32:26 - INFO - Train metrics: 0.00017866522443853085 | Validation metrics: 0.00018998260070061818
03-05 15:32:26 - INFO - Train metrics: 0.00017789459428726637 | Validation metrics: 0.00018908438917174182
03-05 15:32:26 - INFO - Train metrics: 0.00017711882898759068 | Validation metrics: 0.00018818887165804026
03-05 15:32:26 - INFO - Train metrics: 0.00017633861609014513 | Validation metrics: 0.00018729574830186638
03-05 15:32:26 - INFO - Train metrics: 0.00017555380989342257 | Validation metrics: 0.00018640446789431
03-05 15:32:26 - INFO - Train metrics: 0.00017476342185190354 | Validation metrics: 0.00018551567498232343
03-05 15:32:26 - INFO - Train metrics: 0.00017397046377438876 | Validation metrics: 0.00018462994737983353
03-05 15:32:26 - INFO - Train metrics: 0.00017317469502544793 | Validation metrics: 0.0001837471209000796
03-05 15:32:26 - INFO - Train metrics: 0.00017237374149111186 | Validation metrics: 0.0001828670435563915
03-05 15:32:26 - INFO - Train metrics: 0.00017156901237301594 | Validation metrics: 0.0001819897203463967
03-05 15:32:26 - INFO - Train metrics: 0.00017076386974711335 | Validation metrics: 0.00018111683106087525
03-05 15:32:26 - INFO - Train metrics: 0.00016995520931423495 | Validation metrics: 0.00018024754991538523
03-05 15:32:26 - INFO - Train metrics: 0.00016914572784698155 | Validation metrics: 0.00017938267991106694
03-05 15:32:27 - INFO - Train metrics: 0.00016833486365601375 | Validation metrics: 0.00017852227411096483
03-05 15:32:27 - INFO - Train metrics: 0.00016752328780709642 | Validation metrics: 0.00017766710332561887
03-05 15:32:27 - INFO - Train metrics: 0.00016671013495363156 | Validation metrics: 0.00017681607939514586
03-05 15:32:27 - INFO - Train metrics: 0.00016589944589624 | Validation metrics: 0.0001759717342058065
03-05 15:32:27 - INFO - Train metrics: 0.00016508710835120853 | Validation metrics: 0.00017513226905268512
03-05 15:32:27 - INFO - Train metrics: 0.00016427705523804214 | Validation metrics: 0.00017429965520583356
03-05 15:32:27 - INFO - Train metrics: 0.00016346896925934108 | Validation metrics: 0.00017347370922292648
03-05 15:32:27 - INFO - Train metrics: 0.0001626636395738565 | Validation metrics: 0.00017265550412397568
03-05 15:32:27 - INFO - Train metrics: 0.0001618617988103431 | Validation metrics: 0.0001718445482306333
03-05 15:32:27 - INFO - Train metrics: 0.00016106122282344177 | Validation metrics: 0.00017104112052810237
03-05 15:32:27 - INFO - Train metrics: 0.00016026746019642837 | Validation metrics: 0.00017024712276061753
../_images/narx_neural_network_22_2001.png