V0.1.6 - 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)Note: you may need to restart the kernel to use updated packages.
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: 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: 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: 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: six in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from cycler>=0.10->matplotlib>=3.3.2->sysidentpy) (1.16.0)
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:09:35 - INFO - Train metrics: 0.1083807830038226 | Validation metrics: 0.08544350189693047
10-24 13:09:35 - INFO - Train metrics: 0.018048699688455815 | Validation metrics: 0.01576778892841604
10-24 13:09:35 - INFO - Train metrics: 0.010208713051799993 | Validation metrics: 0.009892617060680581
10-24 13:09:35 - INFO - Train metrics: 0.007793382812702193 | Validation metrics: 0.006647734771096947
10-24 13:09:35 - INFO - Train metrics: 0.0048156815585691974 | Validation metrics: 0.003369582243113205
10-24 13:09:35 - INFO - Train metrics: 0.003286978898611956 | Validation metrics: 0.0025566219366296673
10-24 13:09:35 - INFO - Train metrics: 0.0027656210215883633 | Validation metrics: 0.0017093710573107908
10-24 13:09:35 - INFO - Train metrics: 0.0025453113327573115 | Validation metrics: 0.0013575999153251149
10-24 13:09:35 - INFO - Train metrics: 0.0021972812672512126 | Validation metrics: 0.0014747194393133424
10-24 13:09:35 - INFO - Train metrics: 0.002046868148759325 | Validation metrics: 0.0013751951281470482
10-24 13:09:35 - INFO - Train metrics: 0.001912152345635389 | Validation metrics: 0.0011875145889893926
10-24 13:09:35 - INFO - Train metrics: 0.0017813366250179353 | Validation metrics: 0.0011932000287366335
10-24 13:09:35 - INFO - Train metrics: 0.0016735314229914082 | Validation metrics: 0.0011280049508757362
10-24 13:09:35 - INFO - Train metrics: 0.0015826680388810455 | Validation metrics: 0.0010734730120277917
10-24 13:09:36 - INFO - Train metrics: 0.0014965972340289962 | Validation metrics: 0.0010487612565001003
10-24 13:09:36 - INFO - Train metrics: 0.0014233786915020463 | Validation metrics: 0.0009906953906245303
10-24 13:09:36 - INFO - Train metrics: 0.0013532671414521105 | Validation metrics: 0.0009562081217558847
10-24 13:09:36 - INFO - Train metrics: 0.0012895044410265143 | Validation metrics: 0.0009196642633395815
10-24 13:09:36 - INFO - Train metrics: 0.0012287157363045896 | Validation metrics: 0.0008785746711767232
10-24 13:09:36 - INFO - Train metrics: 0.0011670605517587716 | Validation metrics: 0.0008407015567457284
10-24 13:09:36 - INFO - Train metrics: 0.0011023840472221206 | Validation metrics: 0.0007965846158883939
10-24 13:09:36 - INFO - Train metrics: 0.001031745776048579 | Validation metrics: 0.0007498615604797096
10-24 13:09:36 - INFO - Train metrics: 0.00095715422508888 | Validation metrics: 0.0006986556191354839
10-24 13:09:36 - INFO - Train metrics: 0.0008843103047334274 | Validation metrics: 0.0006500105173656284
10-24 13:09:36 - INFO - Train metrics: 0.0008221539700249757 | Validation metrics: 0.0006104401186945839
10-24 13:09:36 - INFO - Train metrics: 0.0007758168166650361 | Validation metrics: 0.0005828702982251693
10-24 13:09:36 - INFO - Train metrics: 0.0007409578081883284 | Validation metrics: 0.0005615248757583851
10-24 13:09:36 - INFO - Train metrics: 0.0007066943062432017 | Validation metrics: 0.0005354017102761627
10-24 13:09:36 - INFO - Train metrics: 0.0006664554986905512 | Validation metrics: 0.000499985250761977
10-24 13:09:36 - INFO - Train metrics: 0.0006244773445487546 | Validation metrics: 0.00046218307030321373
10-24 13:09:36 - INFO - Train metrics: 0.0005884973766582138 | Validation metrics: 0.0004315332908211558
10-24 13:09:36 - INFO - Train metrics: 0.000561242043752606 | Validation metrics: 0.00041008407115992725
10-24 13:09:36 - INFO - Train metrics: 0.0005394986723135354 | Validation metrics: 0.0003935284171761437
10-24 13:09:36 - INFO - Train metrics: 0.0005182584367352853 | Validation metrics: 0.00037681819598256336
10-24 13:09:36 - INFO - Train metrics: 0.0004971872672046486 | Validation metrics: 0.0003605619704379051
10-24 13:09:36 - INFO - Train metrics: 0.00047893535349002213 | Validation metrics: 0.00034753973519363715
10-24 13:09:36 - INFO - Train metrics: 0.00046273967879065746 | Validation metrics: 0.0003363432975913953
10-24 13:09:36 - INFO - Train metrics: 0.0004465349405457763 | Validation metrics: 0.00032491280228097105
10-24 13:09:36 - INFO - Train metrics: 0.0004312717821157274 | Validation metrics: 0.00031468658937338853
10-24 13:09:36 - INFO - Train metrics: 0.00041727451849752164 | Validation metrics: 0.0003058106904247343
10-24 13:09:36 - INFO - Train metrics: 0.00040342369951881974 | Validation metrics: 0.0002968534118745175
10-24 13:09:36 - INFO - Train metrics: 0.0003903181556749968 | Validation metrics: 0.00028863184934839454
10-24 13:09:36 - INFO - Train metrics: 0.00037791051898667484 | Validation metrics: 0.0002811384417300084
10-24 13:09:36 - INFO - Train metrics: 0.0003658144957710403 | Validation metrics: 0.0002738059030356582
10-24 13:09:36 - INFO - Train metrics: 0.00035437554433792454 | Validation metrics: 0.00026700628928445053
10-24 13:09:36 - INFO - Train metrics: 0.0003433406527984519 | Validation metrics: 0.00026048718589461513
10-24 13:09:36 - INFO - Train metrics: 0.0003328201601927736 | Validation metrics: 0.00025435170303381074
10-24 13:09:36 - INFO - Train metrics: 0.00032272014142110955 | Validation metrics: 0.00024846853421427157
10-24 13:09:36 - INFO - Train metrics: 0.0003130861462028534 | Validation metrics: 0.00024288312256844208
10-24 13:09:36 - INFO - Train metrics: 0.00030385330961293596 | Validation metrics: 0.0002375309028653334
10-24 13:09:36 - INFO - Train metrics: 0.00029505418472337467 | Validation metrics: 0.00023244109035309667
10-24 13:09:36 - INFO - Train metrics: 0.0002866280325694257 | Validation metrics: 0.00022755510196080338
10-24 13:09:36 - INFO - Train metrics: 0.0002786044098050532 | Validation metrics: 0.0002229017534203865
10-24 13:09:36 - INFO - Train metrics: 0.0002709319857345955 | Validation metrics: 0.000218432185574049
10-24 13:09:36 - INFO - Train metrics: 0.00026362518881906273 | Validation metrics: 0.00021416659971388677
10-24 13:09:36 - INFO - Train metrics: 0.00025665506187775043 | Validation metrics: 0.00021007827705365014
10-24 13:09:36 - INFO - Train metrics: 0.0002500147703611397 | Validation metrics: 0.0002061645547398413
10-24 13:09:36 - INFO - Train metrics: 0.0002436922662316665 | Validation metrics: 0.00020241751520767468
10-24 13:09:36 - INFO - Train metrics: 0.0002376733277092821 | Validation metrics: 0.00019882635446853296
10-24 13:09:36 - INFO - Train metrics: 0.00023195119300404362 | Validation metrics: 0.00019538802220580177
10-24 13:09:36 - INFO - Train metrics: 0.00022651203579058109 | Validation metrics: 0.00019209184760293652
10-24 13:09:36 - INFO - Train metrics: 0.00022134802407494054 | Validation metrics: 0.00018893368115926142
10-24 13:09:36 - INFO - Train metrics: 0.00021644909697658333 | Validation metrics: 0.00018590745693096195
10-24 13:09:36 - INFO - Train metrics: 0.00021180812073818975 | Validation metrics: 0.00018300808454049995
10-24 13:09:36 - INFO - Train metrics: 0.00020741667727739048 | Validation metrics: 0.00018023185751217446
10-24 13:09:36 - INFO - Train metrics: 0.00020326772080483452 | Validation metrics: 0.00017757445789586676
10-24 13:09:36 - INFO - Train metrics: 0.0001993569430783111 | Validation metrics: 0.0001750354692716189
10-24 13:09:36 - INFO - Train metrics: 0.0001956797349701442 | Validation metrics: 0.0001726138190603862
10-24 13:09:36 - INFO - Train metrics: 0.00019223361528760994 | Validation metrics: 0.00017031105946645967
10-24 13:09:36 - INFO - Train metrics: 0.00018901858534366313 | Validation metrics: 0.00016813194485042584
10-24 13:09:36 - INFO - Train metrics: 0.00018603685217878004 | Validation metrics: 0.00016608369957674482
10-24 13:09:36 - INFO - Train metrics: 0.0001832955345971846 | Validation metrics: 0.00016417999465531208
10-24 13:09:36 - INFO - Train metrics: 0.0001808066604315259 | Validation metrics: 0.00016244080398617445
10-24 13:09:36 - INFO - Train metrics: 0.00017858805771091984 | Validation metrics: 0.00016089376195032866
10-24 13:09:36 - INFO - Train metrics: 0.00017666707531943508 | Validation metrics: 0.00015958045542268366
10-24 13:09:36 - INFO - Train metrics: 0.00017508458349629676 | Validation metrics: 0.00015855942837508262
10-24 13:09:36 - INFO - Train metrics: 0.00017389459935201326 | Validation metrics: 0.00015790890734713298
10-24 13:09:36 - INFO - Train metrics: 0.00017317323151854494 | Validation metrics: 0.00015773726574314588
10-24 13:09:36 - INFO - Train metrics: 0.0001730165731486862 | Validation metrics: 0.00015818114443023624
10-24 13:09:36 - INFO - Train metrics: 0.00017353801353178677 | Validation metrics: 0.00015940689487674395
10-24 13:09:36 - INFO - Train metrics: 0.00017484907034018957 | Validation metrics: 0.00016158619881466484
10-24 13:09:36 - INFO - Train metrics: 0.0001770212947575371 | Validation metrics: 0.00016485778141573938
10-24 13:09:36 - INFO - Train metrics: 0.00018002406601650515 | Validation metrics: 0.00016925504167724137
10-24 13:09:36 - INFO - Train metrics: 0.0001836319784149481 | Validation metrics: 0.00017459563675190727
10-24 13:09:36 - INFO - Train metrics: 0.00018735186685282822 | Validation metrics: 0.00018038600668513375
10-24 13:09:36 - INFO - Train metrics: 0.00019039372648906085 | Validation metrics: 0.00018576875557144634
10-24 13:09:36 - INFO - Train metrics: 0.0001917561091789579 | Validation metrics: 0.00018958539691415024
10-24 13:09:36 - INFO - Train metrics: 0.00019045419188509264 | Validation metrics: 0.00019060631151513355
10-24 13:09:36 - INFO - Train metrics: 0.0001858609897667486 | Validation metrics: 0.00018789850715124473
10-24 13:09:36 - INFO - Train metrics: 0.0001780910615547838 | Validation metrics: 0.00018127507152684936
10-24 13:09:36 - INFO - Train metrics: 0.00016822907633823867 | Validation metrics: 0.00017162100538362118
10-24 13:09:36 - INFO - Train metrics: 0.0001581558694521474 | Validation metrics: 0.00016082026978079793
10-24 13:09:37 - INFO - Train metrics: 0.0001497724813652484 | Validation metrics: 0.00015102100756720198
10-24 13:09:37 - INFO - Train metrics: 0.00014402252978051226 | Validation metrics: 0.00014355834256010976
10-24 13:09:37 - INFO - Train metrics: 0.00014077105480193728 | Validation metrics: 0.0001386175012378248
10-24 13:09:37 - INFO - Train metrics: 0.0001398917456229864 | Validation metrics: 0.00013620426644326536
10-24 13:09:37 - INFO - Train metrics: 0.0001415704995689022 | Validation metrics: 0.0001365897766634295
10-24 13:09:37 - INFO - Train metrics: 0.00014441740260147875 | Validation metrics: 0.00013857003906388965
10-24 13:09:37 - INFO - Train metrics: 0.0001450830573151308 | Validation metrics: 0.00013888319774949453
10-24 13:09:37 - INFO - Train metrics: 0.00014222979863328313 | Validation metrics: 0.00013600849541200495
10-24 13:09:37 - INFO - Train metrics: 0.00013844463829082999 | Validation metrics: 0.00013238919288569102
10-24 13:09:37 - INFO - Train metrics: 0.00013626443577684078 | Validation metrics: 0.0001306108397789149
10-24 13:09:37 - INFO - Train metrics: 0.00013596943074418348 | Validation metrics: 0.0001307894078005726
10-24 13:09:37 - INFO - Train metrics: 0.00013654134770940503 | Validation metrics: 0.00013149259544349267
10-24 13:09:37 - INFO - Train metrics: 0.00013630092169542127 | Validation metrics: 0.0001308779973616692
10-24 13:09:37 - INFO - Train metrics: 0.0001350492314128602 | Validation metrics: 0.0001290534298709415
10-24 13:09:37 - INFO - Train metrics: 0.00013407633835648216 | Validation metrics: 0.00012776716859221006
10-24 13:09:37 - INFO - Train metrics: 0.00013388560746124196 | Validation metrics: 0.00012758933742662345
10-24 13:09:37 - INFO - Train metrics: 0.00013387236361366166 | Validation metrics: 0.00012762020659548315
10-24 13:09:37 - INFO - Train metrics: 0.00013354324083162568 | Validation metrics: 0.00012721727493999883
10-24 13:09:37 - INFO - Train metrics: 0.00013315799528788915 | Validation metrics: 0.0001267446353478884
10-24 13:09:37 - INFO - Train metrics: 0.0001329047197504039 | Validation metrics: 0.0001264562144772046
10-24 13:09:37 - INFO - Train metrics: 0.0001326788105665797 | Validation metrics: 0.00012621557548162386
10-24 13:09:37 - INFO - Train metrics: 0.00013249886639703318 | Validation metrics: 0.00012604120576100404
10-24 13:09:37 - INFO - Train metrics: 0.00013238921126042653 | Validation metrics: 0.00012596258440882794
10-24 13:09:37 - INFO - Train metrics: 0.00013230077649979037 | Validation metrics: 0.00012591480532651674
10-24 13:09:37 - INFO - Train metrics: 0.00013226124233791468 | Validation metrics: 0.00012592899153300683
10-24 13:09:37 - INFO - Train metrics: 0.00013226462695292457 | Validation metrics: 0.000125998290105149
10-24 13:09:37 - INFO - Train metrics: 0.00013229812418529647 | Validation metrics: 0.00012610690574740258
10-24 13:09:37 - INFO - Train metrics: 0.0001323778170378608 | Validation metrics: 0.000126274979633345
10-24 13:09:37 - INFO - Train metrics: 0.0001324964714581427 | Validation metrics: 0.00012649406783042872
10-24 13:09:37 - INFO - Train metrics: 0.00013266103574860244 | Validation metrics: 0.00012677135266424768
10-24 13:09:37 - INFO - Train metrics: 0.00013286773994200884 | Validation metrics: 0.00012710170436420036
10-24 13:09:37 - INFO - Train metrics: 0.00013312032654295609 | Validation metrics: 0.0001274880033275677
10-24 13:09:37 - INFO - Train metrics: 0.0001334210290698414 | Validation metrics: 0.00012793111870055925
10-24 13:09:37 - INFO - Train metrics: 0.00013377053441682873 | Validation metrics: 0.0001284289773497166
10-24 13:09:37 - INFO - Train metrics: 0.00013417315440028346 | Validation metrics: 0.00012898420846804676
10-24 13:09:37 - INFO - Train metrics: 0.00013463075356184503 | Validation metrics: 0.0001295950008565654
10-24 13:09:37 - INFO - Train metrics: 0.00013514737664099857 | Validation metrics: 0.00013026222910007669
10-24 13:09:37 - INFO - Train metrics: 0.00013572761062754406 | Validation metrics: 0.0001309855029426722
10-24 13:09:37 - INFO - Train metrics: 0.00013637684622194786 | Validation metrics: 0.00013176418327599424
10-24 13:09:37 - INFO - Train metrics: 0.00013710292077939585 | Validation metrics: 0.0001325995430251527
10-24 13:09:37 - INFO - Train metrics: 0.00013791298833506458 | Validation metrics: 0.0001334898178806679
10-24 13:09:37 - INFO - Train metrics: 0.00013881869454235586 | Validation metrics: 0.00013443666676087588
10-24 13:09:37 - INFO - Train metrics: 0.00013983476123472624 | Validation metrics: 0.0001354420687262477
10-24 13:09:37 - INFO - Train metrics: 0.00014097474682183333 | Validation metrics: 0.00013650493973259336
10-24 13:09:37 - INFO - Train metrics: 0.00014226737269958982 | Validation metrics: 0.00013763677300015145
10-24 13:09:37 - INFO - Train metrics: 0.00014374130136329905 | Validation metrics: 0.00013884641962111786
10-24 13:09:37 - INFO - Train metrics: 0.00014543635790372842 | Validation metrics: 0.00014014976720015207
10-24 13:09:37 - INFO - Train metrics: 0.00014741081486363897 | Validation metrics: 0.00014157981845206873
10-24 13:09:37 - INFO - Train metrics: 0.00014973204604228654 | Validation metrics: 0.0001431741645016397
10-24 13:09:37 - INFO - Train metrics: 0.0001525062178731324 | Validation metrics: 0.00014500813370551727
10-24 13:09:37 - INFO - Train metrics: 0.0001558588096976425 | Validation metrics: 0.00014717314031323175
10-24 13:09:37 - INFO - Train metrics: 0.00015996360256631897 | Validation metrics: 0.00014980866310934564
10-24 13:09:37 - INFO - Train metrics: 0.00016502664029279627 | Validation metrics: 0.0001530858326169446
10-24 13:09:37 - INFO - Train metrics: 0.00017129581464357666 | Validation metrics: 0.00015721948537505184
10-24 13:09:37 - INFO - Train metrics: 0.00017903255194280865 | Validation metrics: 0.0001624452389395711
10-24 13:09:37 - INFO - Train metrics: 0.00018845732913342044 | Validation metrics: 0.00016897447354917536
10-24 13:09:37 - INFO - Train metrics: 0.0001996593954456494 | Validation metrics: 0.00017692444765484054
10-24 13:09:37 - INFO - Train metrics: 0.00021245587189135638 | Validation metrics: 0.0001862096564075204
10-24 13:09:37 - INFO - Train metrics: 0.000226206383643086 | Validation metrics: 0.00019639711183227712
10-24 13:09:37 - INFO - Train metrics: 0.00023969726883987184 | Validation metrics: 0.00020661795567109654
10-24 13:09:37 - INFO - Train metrics: 0.0002511867220930167 | Validation metrics: 0.00021559348202903163
10-24 13:09:37 - INFO - Train metrics: 0.0002587484481760807 | Validation metrics: 0.00022188190110921483
10-24 13:09:37 - INFO - Train metrics: 0.00026093505623162185 | Validation metrics: 0.00022436983411840041
10-24 13:09:37 - INFO - Train metrics: 0.0002574359580952053 | Validation metrics: 0.00022276286494381952
10-24 13:09:37 - INFO - Train metrics: 0.0002493040319176199 | Validation metrics: 0.0002177610033252888
10-24 13:09:37 - INFO - Train metrics: 0.00023855133677125537 | Validation metrics: 0.0002107718364733055
10-24 13:09:37 - INFO - Train metrics: 0.00022732674048362735 | Validation metrics: 0.00020331420290114528
10-24 13:09:37 - INFO - Train metrics: 0.00021726005869091285 | Validation metrics: 0.00019654340414692543
10-24 13:09:37 - INFO - Train metrics: 0.00020919898994626446 | Validation metrics: 0.0001910598119579707
10-24 13:09:37 - INFO - Train metrics: 0.00020335512712071498 | Validation metrics: 0.00018702124523568072
10-24 13:09:37 - INFO - Train metrics: 0.00019954539818530504 | Validation metrics: 0.0001843156046974896
10-24 13:09:37 - INFO - Train metrics: 0.00019741510633346544 | Validation metrics: 0.00018271464649282133
10-24 13:09:37 - INFO - Train metrics: 0.0001965717264532198 | Validation metrics: 0.00018196657839151232
10-24 13:09:37 - INFO - Train metrics: 0.0001966642022697736 | Validation metrics: 0.00018185079585751425
10-24 13:09:37 - INFO - Train metrics: 0.00019738104168581252 | Validation metrics: 0.0001821649737651413
10-24 13:09:37 - INFO - Train metrics: 0.0001984657996545959 | Validation metrics: 0.0001827398815716739
10-24 13:09:37 - INFO - Train metrics: 0.00019973017359070741 | Validation metrics: 0.00018345069721096543
10-24 13:09:37 - INFO - Train metrics: 0.0002010249759462711 | Validation metrics: 0.00018419347017899982
10-24 13:09:37 - INFO - Train metrics: 0.00020225009986579904 | Validation metrics: 0.0001848978975275061
10-24 13:09:38 - INFO - Train metrics: 0.0002033327077617542 | Validation metrics: 0.00018550969179333986
10-24 13:09:38 - INFO - Train metrics: 0.00020424558091494384 | Validation metrics: 0.00018600957389365919
10-24 13:09:38 - INFO - Train metrics: 0.000204958345612364 | Validation metrics: 0.0001863707302342818
10-24 13:09:38 - INFO - Train metrics: 0.00020548373769751672 | Validation metrics: 0.0001866033696451911
10-24 13:09:38 - INFO - Train metrics: 0.00020582979362058853 | Validation metrics: 0.00018670966315454795
10-24 13:09:38 - INFO - Train metrics: 0.00020600979070950598 | Validation metrics: 0.0001866956715615504
10-24 13:09:38 - INFO - Train metrics: 0.00020606023158655176 | Validation metrics: 0.00018658834001557395
10-24 13:09:38 - INFO - Train metrics: 0.00020599063900316876 | Validation metrics: 0.00018638946575164382
10-24 13:09:38 - INFO - Train metrics: 0.00020583331839351876 | Validation metrics: 0.0001861223094917909
10-24 13:09:38 - INFO - Train metrics: 0.00020560679073506187 | Validation metrics: 0.00018579860757613048
10-24 13:09:38 - INFO - Train metrics: 0.0002053259377864383 | Validation metrics: 0.0001854269672420365
10-24 13:09:38 - INFO - Train metrics: 0.00020501154187085215 | Validation metrics: 0.00018502351612727526
10-24 13:09:38 - INFO - Train metrics: 0.00020466394377300484 | Validation metrics: 0.00018458537912617126
10-24 13:09:38 - INFO - Train metrics: 0.0002042944695876986 | Validation metrics: 0.0001841221336037805
10-24 13:09:38 - INFO - Train metrics: 0.0002039084867469238 | Validation metrics: 0.00018363763155495615
10-24 13:09:38 - INFO - Train metrics: 0.00020350218315948418 | Validation metrics: 0.000183127893545345
10-24 13:09:38 - INFO - Train metrics: 0.00020308624883007287 | Validation metrics: 0.0001826033962189662
10-24 13:09:38 - INFO - Train metrics: 0.00020265215414810815 | Validation metrics: 0.0001820565821341888
10-24 13:09:38 - INFO - Train metrics: 0.00020220340557809555 | Validation metrics: 0.000181491334006576
10-24 13:09:38 - INFO - Train metrics: 0.00020174057823068984 | Validation metrics: 0.00018090812734568095
10-24 13:09:38 - INFO - Train metrics: 0.00020126140339301202 | Validation metrics: 0.0001803063330384009
10-24 13:09:38 - INFO - Train metrics: 0.00020076871792264143 | Validation metrics: 0.00017968869551715226
10-24 13:09:38 - INFO - Train metrics: 0.0002002684840200735 | Validation metrics: 0.00017906086357084638
10-24 13:09:38 - INFO - Train metrics: 0.00019974773308410447 | Validation metrics: 0.00017841250445773692
10-24 13:09:38 - INFO - Train metrics: 0.00019922294430166278 | Validation metrics: 0.0001777579862097598
10-24 13:09:38 - INFO - Train metrics: 0.00019868578515126414 | Validation metrics: 0.0001770899016080857
10-24 13:09:38 - INFO - Train metrics: 0.00019814175829923895 | Validation metrics: 0.00017641412506980652
10-24 13:09:38 - INFO - Train metrics: 0.00019759505655719223 | Validation metrics: 0.00017573461868456856
10-24 13:09:38 - INFO - Train metrics: 0.00019704222138346706 | Validation metrics: 0.00017504798303678105
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.00021030630877298713
../_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)
10-24 13:09:38 - INFO - Train metrics: 0.16773541174586257 | Validation metrics: 0.14084541014950686
10-24 13:09:38 - INFO - Train metrics: 0.020779614988014214 | Validation metrics: 0.016522999834081138
10-24 13:09:38 - INFO - Train metrics: 0.02156141174392294 | Validation metrics: 0.0208760474930809
10-24 13:09:38 - INFO - Train metrics: 0.003833557455158585 | Validation metrics: 0.0038893313636307165
10-24 13:09:38 - INFO - Train metrics: 0.005254527264482395 | Validation metrics: 0.0037917061238502614
10-24 13:09:38 - INFO - Train metrics: 0.0024094607512977788 | Validation metrics: 0.0021064658884448234
10-24 13:09:38 - INFO - Train metrics: 0.002038692484812853 | Validation metrics: 0.002185657862667935
10-24 13:09:38 - INFO - Train metrics: 0.00152388171795849 | Validation metrics: 0.0014166856017622232
10-24 13:09:38 - INFO - Train metrics: 0.0014438493749743006 | Validation metrics: 0.0012283794290263844
10-24 13:09:38 - INFO - Train metrics: 0.0012153149223571322 | Validation metrics: 0.0011225489410336572
10-24 13:09:38 - INFO - Train metrics: 0.0011703957804130919 | Validation metrics: 0.0011107589216959295
10-24 13:09:38 - INFO - Train metrics: 0.0010739544489395275 | Validation metrics: 0.0009545081958287593
10-24 13:09:38 - INFO - Train metrics: 0.0010111934647202155 | Validation metrics: 0.0008855251244956044
10-24 13:09:38 - INFO - Train metrics: 0.0009554763476861487 | Validation metrics: 0.0008554222953571666
10-24 13:09:39 - INFO - Train metrics: 0.0009017393398822232 | Validation metrics: 0.0007876232901418751
10-24 13:09:39 - INFO - Train metrics: 0.0008577022431324934 | Validation metrics: 0.0007297397541785331
10-24 13:09:39 - INFO - Train metrics: 0.0008151855153139017 | Validation metrics: 0.0006973338648535763
10-24 13:09:39 - INFO - Train metrics: 0.0007786636896090661 | Validation metrics: 0.0006532020281266534
10-24 13:09:39 - INFO - Train metrics: 0.0007448024074150189 | Validation metrics: 0.0006187889846088835
10-24 13:09:39 - INFO - Train metrics: 0.0007117408221846629 | Validation metrics: 0.0005922666409833715
10-24 13:09:39 - INFO - Train metrics: 0.0006805605262069774 | Validation metrics: 0.0005649267983942697
10-24 13:09:39 - INFO - Train metrics: 0.0006520222473649172 | Validation metrics: 0.00054561571544977
10-24 13:09:39 - INFO - Train metrics: 0.0006290095024403735 | Validation metrics: 0.0005311704807529095
10-24 13:09:39 - INFO - Train metrics: 0.0006100067563639735 | Validation metrics: 0.0005182985226962377
10-24 13:09:39 - INFO - Train metrics: 0.0005913464814065057 | Validation metrics: 0.0005029437644877518
10-24 13:09:39 - INFO - Train metrics: 0.0005720542658605895 | Validation metrics: 0.00048454935460191486
10-24 13:09:39 - INFO - Train metrics: 0.000554049444468902 | Validation metrics: 0.00046798977953842793
10-24 13:09:39 - INFO - Train metrics: 0.0005381569650869135 | Validation metrics: 0.0004552918776747479
10-24 13:09:39 - INFO - Train metrics: 0.0005237375421654946 | Validation metrics: 0.0004443642530458594
10-24 13:09:39 - INFO - Train metrics: 0.0005095933966938509 | Validation metrics: 0.0004328479931567504
10-24 13:09:39 - INFO - Train metrics: 0.000495727007822332 | Validation metrics: 0.000421183833480822
10-24 13:09:39 - INFO - Train metrics: 0.0004827823842359814 | Validation metrics: 0.0004110567949622907
10-24 13:09:39 - INFO - Train metrics: 0.0004704621448187405 | Validation metrics: 0.00040137678510603503
10-24 13:09:39 - INFO - Train metrics: 0.00045838469429639516 | Validation metrics: 0.0003914514684701583
10-24 13:09:39 - INFO - Train metrics: 0.000446853176854028 | Validation metrics: 0.0003822918718497297
10-24 13:09:39 - INFO - Train metrics: 0.0004357952796118824 | Validation metrics: 0.0003735350966430034
10-24 13:09:39 - INFO - Train metrics: 0.00042502343888630286 | Validation metrics: 0.0003647495198152922
10-24 13:09:39 - INFO - Train metrics: 0.0004147007582326394 | Validation metrics: 0.0003564825203302646
10-24 13:09:39 - INFO - Train metrics: 0.0004047199397057267 | Validation metrics: 0.00034843417557163373
10-24 13:09:39 - INFO - Train metrics: 0.00039506456057569083 | Validation metrics: 0.0003406083228353486
10-24 13:09:39 - INFO - Train metrics: 0.0003857593100085005 | Validation metrics: 0.00033306490719280763
10-24 13:09:39 - INFO - Train metrics: 0.000376753786078101 | Validation metrics: 0.00032573427641623175
10-24 13:09:39 - INFO - Train metrics: 0.0003680605760817521 | Validation metrics: 0.00031866764707368507
10-24 13:09:39 - INFO - Train metrics: 0.0003596518170771266 | Validation metrics: 0.0003117897984044946
10-24 13:09:39 - INFO - Train metrics: 0.00035152640122217696 | Validation metrics: 0.00030514864325100047
10-24 13:09:39 - INFO - Train metrics: 0.000343669322100503 | Validation metrics: 0.00029869828516655044
10-24 13:09:39 - INFO - Train metrics: 0.0003360719660724184 | Validation metrics: 0.0002924541247811056
10-24 13:09:39 - INFO - Train metrics: 0.0003287246954664681 | Validation metrics: 0.0002863938979583444
10-24 13:09:39 - INFO - Train metrics: 0.00032161864134620756 | Validation metrics: 0.00028051572588432314
10-24 13:09:39 - INFO - Train metrics: 0.00031474566849807564 | Validation metrics: 0.00027481027916450093
10-24 13:09:39 - INFO - Train metrics: 0.0003080976186588612 | Validation metrics: 0.00026926913503275227
10-24 13:09:39 - INFO - Train metrics: 0.0003016672902717197 | Validation metrics: 0.0002638870195222247
10-24 13:09:39 - INFO - Train metrics: 0.000295447563620653 | Validation metrics: 0.0002586549086816082
10-24 13:09:39 - INFO - Train metrics: 0.00028943152395648913 | Validation metrics: 0.0002535644511814521
10-24 13:09:39 - INFO - Train metrics: 0.0002836136828730452 | Validation metrics: 0.0002486122110058939
10-24 13:09:39 - INFO - Train metrics: 0.0002779887473026295 | Validation metrics: 0.00024379168183194717
10-24 13:09:39 - INFO - Train metrics: 0.00027255082262544556 | Validation metrics: 0.0002390937623920653
10-24 13:09:39 - INFO - Train metrics: 0.00026729657503053836 | Validation metrics: 0.00023451587596832953
10-24 13:09:39 - INFO - Train metrics: 0.0002622221921714149 | Validation metrics: 0.0002300536672754044
10-24 13:09:39 - INFO - Train metrics: 0.00025732576694481894 | Validation metrics: 0.0002257026019953003
10-24 13:09:39 - INFO - Train metrics: 0.00025260535147295505 | Validation metrics: 0.0002214619422430229
10-24 13:09:39 - INFO - Train metrics: 0.0002480609396651719 | Validation metrics: 0.00021733159806127801
10-24 13:09:39 - INFO - Train metrics: 0.00024369410732247515 | Validation metrics: 0.0002133161558021763
10-24 13:09:39 - INFO - Train metrics: 0.00023950758838137953 | Validation metrics: 0.00020942387184024684
10-24 13:09:39 - INFO - Train metrics: 0.00023550636470282829 | Validation metrics: 0.00020566888799128884
10-24 13:09:39 - INFO - Train metrics: 0.0002316980072580754 | Validation metrics: 0.00020207624442668425
10-24 13:09:39 - INFO - Train metrics: 0.0002280920716224327 | Validation metrics: 0.00019868098994872221
10-24 13:09:39 - INFO - Train metrics: 0.0002247051866961419 | Validation metrics: 0.00019553679216775403
10-24 13:09:39 - INFO - Train metrics: 0.00022156477558168635 | Validation metrics: 0.00019272568155282336
10-24 13:09:39 - INFO - Train metrics: 0.00021871846202932494 | Validation metrics: 0.0001903657461610632
10-24 13:09:39 - INFO - Train metrics: 0.00021625029137311387 | Validation metrics: 0.00018862993697485312
10-24 13:09:39 - INFO - Train metrics: 0.00021430211054029313 | Validation metrics: 0.0001877630427844277
10-24 13:09:39 - INFO - Train metrics: 0.00021308547490974305 | Validation metrics: 0.0001880842164885535
10-24 13:09:39 - INFO - Train metrics: 0.0002128758957101275 | Validation metrics: 0.0001899685648639188
10-24 13:09:39 - INFO - Train metrics: 0.0002139657063664691 | Validation metrics: 0.00019377793906835106
10-24 13:09:39 - INFO - Train metrics: 0.0002165602639441222 | Validation metrics: 0.00019973191015793933
10-24 13:09:39 - INFO - Train metrics: 0.0002206496246343474 | Validation metrics: 0.00020775939173281493
10-24 13:09:39 - INFO - Train metrics: 0.00022588994568167138 | Validation metrics: 0.00021735993313904136
10-24 13:09:39 - INFO - Train metrics: 0.00023156409378701537 | Validation metrics: 0.0002275638486907789
10-24 13:09:39 - INFO - Train metrics: 0.00023664942803824167 | Validation metrics: 0.00023700741314884238
10-24 13:09:39 - INFO - Train metrics: 0.00024001759289207176 | Validation metrics: 0.0002441678356115866
10-24 13:09:39 - INFO - Train metrics: 0.00024070103059319737 | Validation metrics: 0.000247677235459589
10-24 13:09:39 - INFO - Train metrics: 0.00023820332447265305 | Validation metrics: 0.00024670627964143123
10-24 13:09:39 - INFO - Train metrics: 0.00023277075271201518 | Validation metrics: 0.00024133702861192175
10-24 13:09:39 - INFO - Train metrics: 0.00022544728411579817 | Validation metrics: 0.00023272242238321766
10-24 13:09:39 - INFO - Train metrics: 0.00021775993630861895 | Validation metrics: 0.00022283889943583294
10-24 13:09:39 - INFO - Train metrics: 0.0002110630015531592 | Validation metrics: 0.00021375667284985984
10-24 13:09:39 - INFO - Train metrics: 0.00020604548688579985 | Validation metrics: 0.00020690116592720527
10-24 13:09:39 - INFO - Train metrics: 0.00020269927306726276 | Validation metrics: 0.0002026679076611845
10-24 13:09:39 - INFO - Train metrics: 0.00020045442726226165 | Validation metrics: 0.00020032910444312777
10-24 13:09:39 - INFO - Train metrics: 0.0001983275982921238 | Validation metrics: 0.00019831178331220842
10-24 13:09:39 - INFO - Train metrics: 0.0001956760705498871 | Validation metrics: 0.0001954569647704825
10-24 13:09:40 - INFO - Train metrics: 0.0001929369893314242 | Validation metrics: 0.00019222172021259075
10-24 13:09:40 - INFO - Train metrics: 0.00019090716824236612 | Validation metrics: 0.00018981310366676424
10-24 13:09:40 - INFO - Train metrics: 0.00018949535783884444 | Validation metrics: 0.00018831303947595786
10-24 13:09:40 - INFO - Train metrics: 0.0001878959620514427 | Validation metrics: 0.00018662531760808157
10-24 13:09:40 - INFO - Train metrics: 0.00018601626337051886 | Validation metrics: 0.00018444204584794176
10-24 13:09:40 - INFO - Train metrics: 0.00018462202259932265 | Validation metrics: 0.00018277149670992536
10-24 13:09:40 - INFO - Train metrics: 0.00018373619963299426 | Validation metrics: 0.00018183187498696938
10-24 13:09:40 - INFO - Train metrics: 0.00018248764078400068 | Validation metrics: 0.00018051860961625636
10-24 13:09:40 - INFO - Train metrics: 0.0001809493232872057 | Validation metrics: 0.00017876927729112784
10-24 13:09:40 - INFO - Train metrics: 0.00017995112919147105 | Validation metrics: 0.00017763373960571533
10-24 13:09:40 - INFO - Train metrics: 0.0001791609294860178 | Validation metrics: 0.0001767956432145597
10-24 13:09:40 - INFO - Train metrics: 0.00017795801372208952 | Validation metrics: 0.00017547715091348784
10-24 13:09:40 - INFO - Train metrics: 0.0001768704279769973 | Validation metrics: 0.0001742918675793617
10-24 13:09:40 - INFO - Train metrics: 0.00017608654445923052 | Validation metrics: 0.00017346140682800778
10-24 13:09:40 - INFO - Train metrics: 0.00017517706350701157 | Validation metrics: 0.0001724652151960522
10-24 13:09:40 - INFO - Train metrics: 0.00017430315932514553 | Validation metrics: 0.00017153384470300882
10-24 13:09:40 - INFO - Train metrics: 0.00017353607214582305 | Validation metrics: 0.000170736908036604
10-24 13:09:40 - INFO - Train metrics: 0.00017276829044990483 | Validation metrics: 0.00016992369909521492
10-24 13:09:40 - INFO - Train metrics: 0.0001720863837634393 | Validation metrics: 0.00016921571005521475
10-24 13:09:40 - INFO - Train metrics: 0.0001714394134536437 | Validation metrics: 0.0001685496106875515
10-24 13:09:40 - INFO - Train metrics: 0.0001708373356929147 | Validation metrics: 0.00016793813759277603
10-24 13:09:40 - INFO - Train metrics: 0.0001702930852738711 | Validation metrics: 0.00016739496986518116
10-24 13:09:40 - INFO - Train metrics: 0.00016979372620035225 | Validation metrics: 0.0001669020543105411
10-24 13:09:40 - INFO - Train metrics: 0.00016935258386901726 | Validation metrics: 0.00016647681030632948
10-24 13:09:40 - INFO - Train metrics: 0.00016896006247707943 | Validation metrics: 0.0001661066935136632
10-24 13:09:40 - INFO - Train metrics: 0.00016862013225384142 | Validation metrics: 0.00016579693483160526
10-24 13:09:40 - INFO - Train metrics: 0.00016833507763116824 | Validation metrics: 0.00016554835930965238
10-24 13:09:40 - INFO - Train metrics: 0.00016810421160548308 | Validation metrics: 0.00016535884266215931
10-24 13:09:40 - INFO - Train metrics: 0.000167927429541586 | Validation metrics: 0.0001652268453258927
10-24 13:09:40 - INFO - Train metrics: 0.0001678060016137919 | Validation metrics: 0.00016515315589706668
10-24 13:09:40 - INFO - Train metrics: 0.0001677416655906642 | Validation metrics: 0.00016513716422416496
10-24 13:09:40 - INFO - Train metrics: 0.00016773110921558852 | Validation metrics: 0.0001651727652642876
10-24 13:09:40 - INFO - Train metrics: 0.00016778031609751714 | Validation metrics: 0.00016526419097896326
10-24 13:09:40 - INFO - Train metrics: 0.0001678854811476791 | Validation metrics: 0.00016540306946027534
10-24 13:09:40 - INFO - Train metrics: 0.0001680499832186717 | Validation metrics: 0.00016558920256699427
10-24 13:09:40 - INFO - Train metrics: 0.0001682712285319007 | Validation metrics: 0.00016581437522851194
10-24 13:09:40 - INFO - Train metrics: 0.00016855072592767914 | Validation metrics: 0.00016607361157175454
10-24 13:09:40 - INFO - Train metrics: 0.00016889253867274258 | Validation metrics: 0.000166364609013368
10-24 13:09:40 - INFO - Train metrics: 0.00016929401554672613 | Validation metrics: 0.00016667338213389456
10-24 13:09:40 - INFO - Train metrics: 0.00016975556462326256 | Validation metrics: 0.00016698995552195066
10-24 13:09:40 - INFO - Train metrics: 0.00017028910063853706 | Validation metrics: 0.00016731412471577788
10-24 13:09:40 - INFO - Train metrics: 0.00017088810765338516 | Validation metrics: 0.00016762064846298386
10-24 13:09:40 - INFO - Train metrics: 0.00017156416567347076 | Validation metrics: 0.0001679029806065514
10-24 13:09:40 - INFO - Train metrics: 0.00017232845914036616 | Validation metrics: 0.00016814974772231183
10-24 13:09:40 - INFO - Train metrics: 0.00017319973781389794 | Validation metrics: 0.00016835372397591445
10-24 13:09:40 - INFO - Train metrics: 0.00017420346017858073 | Validation metrics: 0.00016851051601186168
10-24 13:09:40 - INFO - Train metrics: 0.00017538559026397614 | Validation metrics: 0.0001686340007716978
10-24 13:09:40 - INFO - Train metrics: 0.00017682517994543009 | Validation metrics: 0.00016877198085598084
10-24 13:09:40 - INFO - Train metrics: 0.0001786400824490547 | Validation metrics: 0.00016901239848606325
10-24 13:09:40 - INFO - Train metrics: 0.00018102047664555663 | Validation metrics: 0.00016952260259792885
10-24 13:09:40 - INFO - Train metrics: 0.0001842467078441908 | Validation metrics: 0.00017057146966419738
10-24 13:09:40 - INFO - Train metrics: 0.00018870937939234928 | Validation metrics: 0.0001725529960234358
10-24 13:09:40 - INFO - Train metrics: 0.00019489961281246075 | Validation metrics: 0.0001759737747076974
10-24 13:09:40 - INFO - Train metrics: 0.0002033489080187386 | Validation metrics: 0.00018139346429226787
10-24 13:09:40 - INFO - Train metrics: 0.00021445492089505454 | Validation metrics: 0.0001892640700474419
10-24 13:09:40 - INFO - Train metrics: 0.0002281234362150979 | Validation metrics: 0.00019963528632275723
10-24 13:09:40 - INFO - Train metrics: 0.0002432433055100477 | Validation metrics: 0.00021174253579558372
10-24 13:09:40 - INFO - Train metrics: 0.0002572700983560516 | Validation metrics: 0.00022366848295658
10-24 13:09:40 - INFO - Train metrics: 0.00026655853015515385 | Validation metrics: 0.00023255538491701537
10-24 13:09:40 - INFO - Train metrics: 0.0002676812328811371 | Validation metrics: 0.00023554168192368717
10-24 13:09:40 - INFO - Train metrics: 0.0002592525464327385 | Validation metrics: 0.00023115108923215156
10-24 13:09:40 - INFO - Train metrics: 0.00024321011609262447 | Validation metrics: 0.00022045093514448539
10-24 13:09:40 - INFO - Train metrics: 0.00022399543355222567 | Validation metrics: 0.00020662996335298463
10-24 13:09:40 - INFO - Train metrics: 0.00020601980986726005 | Validation metrics: 0.00019310514052807721
10-24 13:09:40 - INFO - Train metrics: 0.00019181826197714976 | Validation metrics: 0.0001820263936715859
10-24 13:09:40 - INFO - Train metrics: 0.00018193706436658088 | Validation metrics: 0.0001740562054857781
10-24 13:09:40 - INFO - Train metrics: 0.00017578208914293878 | Validation metrics: 0.00016892046580617928
10-24 13:09:40 - INFO - Train metrics: 0.0001724439374136769 | Validation metrics: 0.00016601607388689774
10-24 13:09:40 - INFO - Train metrics: 0.00017111874008253638 | Validation metrics: 0.00016475356794832594
10-24 13:09:40 - INFO - Train metrics: 0.0001712037072202452 | Validation metrics: 0.00016465698909179092
10-24 13:09:40 - INFO - Train metrics: 0.0001722740416880697 | Validation metrics: 0.00016537046376286508
10-24 13:09:40 - INFO - Train metrics: 0.0001740475861897767 | Validation metrics: 0.0001666513087893507
10-24 13:09:40 - INFO - Train metrics: 0.00017633707165416976 | Validation metrics: 0.00016833658887524948
10-24 13:09:40 - INFO - Train metrics: 0.00017901514646629884 | Validation metrics: 0.0001703167420628509
10-24 13:09:40 - INFO - Train metrics: 0.00018201289906511948 | Validation metrics: 0.0001725409039698372
10-24 13:09:40 - INFO - Train metrics: 0.00018525960681438307 | Validation metrics: 0.000174955730067773
10-24 13:09:40 - INFO - Train metrics: 0.00018869826570445003 | Validation metrics: 0.00017752778799287185
10-24 13:09:41 - INFO - Train metrics: 0.00019226408200157587 | Validation metrics: 0.00018022005458602285
10-24 13:09:41 - INFO - Train metrics: 0.00019586367464337245 | Validation metrics: 0.00018297213792913791
10-24 13:09:41 - INFO - Train metrics: 0.00019939295954262386 | Validation metrics: 0.00018571845944876774
10-24 13:09:41 - INFO - Train metrics: 0.0002027053953023548 | Validation metrics: 0.0001883503417672608
10-24 13:09:41 - INFO - Train metrics: 0.00020565694925389288 | Validation metrics: 0.00019076267008039384
10-24 13:09:41 - INFO - Train metrics: 0.00020809901413889391 | Validation metrics: 0.00019283777392690418
10-24 13:09:41 - INFO - Train metrics: 0.00020989649515525488 | Validation metrics: 0.0001944605782310563
10-24 13:09:41 - INFO - Train metrics: 0.0002109741662683801 | Validation metrics: 0.00019556047313145803
10-24 13:09:41 - INFO - Train metrics: 0.00021130841737875672 | Validation metrics: 0.00019610162328745267
10-24 13:09:41 - INFO - Train metrics: 0.00021094489135262427 | Validation metrics: 0.00019610171030496595
10-24 13:09:41 - INFO - Train metrics: 0.00020999609626786442 | Validation metrics: 0.00019563277909941408
10-24 13:09:41 - INFO - Train metrics: 0.00020861723862167092 | Validation metrics: 0.00019480305931982443
10-24 13:09:41 - INFO - Train metrics: 0.00020697107684464756 | Validation metrics: 0.00019372837539207227
10-24 13:09:41 - INFO - Train metrics: 0.00020523547896015968 | Validation metrics: 0.0001925461676566758
10-24 13:09:41 - INFO - Train metrics: 0.00020355154460536452 | Validation metrics: 0.00019136456963182852
10-24 13:09:41 - INFO - Train metrics: 0.00020203345014951788 | Validation metrics: 0.0001902761016596071
10-24 13:09:41 - INFO - Train metrics: 0.00020076131905787356 | Validation metrics: 0.00018934782072925244
10-24 13:09:41 - INFO - Train metrics: 0.00019978054035875133 | Validation metrics: 0.00018861969904103928
10-24 13:09:41 - INFO - Train metrics: 0.00019910690692845115 | Validation metrics: 0.00018810949243035994
10-24 13:09:41 - INFO - Train metrics: 0.00019874232273372613 | Validation metrics: 0.0001878239643040367
10-24 13:09:41 - INFO - Train metrics: 0.00019866335379335571 | Validation metrics: 0.0001877474281384205
10-24 13:09:41 - INFO - Train metrics: 0.00019884188387415752 | Validation metrics: 0.00018786230654281686
10-24 13:09:41 - INFO - Train metrics: 0.00019925019693885343 | Validation metrics: 0.0001881509609790895
10-24 13:09:41 - INFO - Train metrics: 0.0001998429261699417 | Validation metrics: 0.00018857815523391986
10-24 13:09:41 - INFO - Train metrics: 0.00020058830382470462 | Validation metrics: 0.00018912509043766845
10-24 13:09:41 - INFO - Train metrics: 0.0002014410509077253 | Validation metrics: 0.0001897549831703531
10-24 13:09:41 - INFO - Train metrics: 0.00020236147821905384 | Validation metrics: 0.00019043960977190486
10-24 13:09:41 - INFO - Train metrics: 0.0002033169147030994 | Validation metrics: 0.00019115686397223422
10-24 13:09:41 - INFO - Train metrics: 0.0002042659181464851 | Validation metrics: 0.00019187370807313445
10-24 13:09:41 - INFO - Train metrics: 0.00020517343200070965 | Validation metrics: 0.00019256381427920941
10-24 13:09:41 - INFO - Train metrics: 0.00020601649491179427 | Validation metrics: 0.0001932108685705867
../_images/narx_neural_network_22_200.png