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)
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: numpy>=1.19.2 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from sysidentpy) (1.20.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: python-dateutil>=2.7 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (2.8.2)
Requirement already satisfied: cycler>=0.10 in c:\users\wilso\miniconda3\envs\sysidentpy\lib\site-packages (from matplotlib>=3.3.2->sysidentpy) (0.10.0)
Requirement already satisfied: 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: 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:31:51 - INFO - Train metrics: 0.19343996630575425 | Validation metrics: 0.1991304031225166
03-05 15:31:51 - INFO - Train metrics: 0.04327842535306338 | Validation metrics: 0.04758032689792941
03-05 15:31:51 - INFO - Train metrics: 0.025610723665782383 | Validation metrics: 0.02548178413299599
03-05 15:31:51 - INFO - Train metrics: 0.004398172075876542 | Validation metrics: 0.004622727270341582
03-05 15:31:51 - INFO - Train metrics: 0.008039619132904406 | Validation metrics: 0.008662900553470609
03-05 15:31:51 - INFO - Train metrics: 0.002184435660147895 | Validation metrics: 0.0021416542056778617
03-05 15:31:51 - INFO - Train metrics: 0.0027702927839169675 | Validation metrics: 0.0027152823726411418
03-05 15:31:51 - INFO - Train metrics: 0.0015358375957268372 | Validation metrics: 0.00179802172586811
03-05 15:31:51 - INFO - Train metrics: 0.0014700872974148147 | Validation metrics: 0.0015498413998313776
03-05 15:31:51 - INFO - Train metrics: 0.0012734647870021767 | Validation metrics: 0.0013730590045922483
03-05 15:31:51 - INFO - Train metrics: 0.001090418686273328 | Validation metrics: 0.00122450032939363
03-05 15:31:51 - INFO - Train metrics: 0.0010352853265763692 | Validation metrics: 0.0011189299861364293
03-05 15:31:51 - INFO - Train metrics: 0.0009501750519987018 | Validation metrics: 0.001036748711038569
03-05 15:31:51 - INFO - Train metrics: 0.0008750128106652925 | Validation metrics: 0.0009649631895378909
03-05 15:31:51 - INFO - Train metrics: 0.0008197147308739094 | Validation metrics: 0.0009031096800239851
03-05 15:31:51 - INFO - Train metrics: 0.0007699950390149907 | Validation metrics: 0.0008475548138540953
03-05 15:31:51 - INFO - Train metrics: 0.0007245720549134122 | Validation metrics: 0.0007996309773215666
03-05 15:31:51 - INFO - Train metrics: 0.0006853860581496772 | Validation metrics: 0.0007588723886080763
03-05 15:31:51 - INFO - Train metrics: 0.0006503045303924452 | Validation metrics: 0.0007234099268151277
03-05 15:31:51 - INFO - Train metrics: 0.0006208106579858912 | Validation metrics: 0.000693216111459252
03-05 15:31:51 - INFO - Train metrics: 0.0005988262501547585 | Validation metrics: 0.0006708889309495613
03-05 15:31:51 - INFO - Train metrics: 0.0005829036912710446 | Validation metrics: 0.0006536748648310701
03-05 15:31:51 - INFO - Train metrics: 0.0005746312857544829 | Validation metrics: 0.0006436425175357874
03-05 15:31:51 - INFO - Train metrics: 0.0005740490235810759 | Validation metrics: 0.0006410705426594976
03-05 15:31:51 - INFO - Train metrics: 0.0005805470997042823 | Validation metrics: 0.0006445168424632889
03-05 15:31:51 - INFO - Train metrics: 0.0005936809149652458 | Validation metrics: 0.0006544019984589381
03-05 15:31:51 - INFO - Train metrics: 0.0006120295580686595 | Validation metrics: 0.0006692110522029301
03-05 15:31:51 - INFO - Train metrics: 0.000632881062171821 | Validation metrics: 0.0006865281799826959
03-05 15:31:51 - INFO - Train metrics: 0.000653461941936868 | Validation metrics: 0.0007038688824530879
03-05 15:31:51 - INFO - Train metrics: 0.0006703054298994535 | Validation metrics: 0.0007180858214122403
03-05 15:31:51 - INFO - Train metrics: 0.000680398386652187 | Validation metrics: 0.0007264025672809268
03-05 15:31:51 - INFO - Train metrics: 0.0006811461472104217 | Validation metrics: 0.0007263401233958024
03-05 15:31:52 - INFO - Train metrics: 0.0006712896019666173 | Validation metrics: 0.0007167885361022946
03-05 15:31:52 - INFO - Train metrics: 0.0006506674500523056 | Validation metrics: 0.0006975975396779526
03-05 15:31:52 - INFO - Train metrics: 0.0006204786215019517 | Validation metrics: 0.0006699189720110911
03-05 15:31:52 - INFO - Train metrics: 0.0005829791672046957 | Validation metrics: 0.000635894393487222
03-05 15:31:52 - INFO - Train metrics: 0.0005412566934229064 | Validation metrics: 0.0005984305806288665
03-05 15:31:52 - INFO - Train metrics: 0.0004987127274096265 | Validation metrics: 0.0005606920728836246
03-05 15:31:52 - INFO - Train metrics: 0.00045856262716513713 | Validation metrics: 0.0005255922612809398
03-05 15:31:52 - INFO - Train metrics: 0.00042330529564118624 | Validation metrics: 0.0004952984281128856
03-05 15:31:52 - INFO - Train metrics: 0.00039432730139431574 | Validation metrics: 0.0004708594907159832
03-05 15:31:52 - INFO - Train metrics: 0.0003717992798177838 | Validation metrics: 0.00045216244744193375
03-05 15:31:52 - INFO - Train metrics: 0.0003549017520232784 | Validation metrics: 0.00043821794620592787
03-05 15:31:52 - INFO - Train metrics: 0.0003422773686059071 | Validation metrics: 0.0004276621553487135
03-05 15:31:52 - INFO - Train metrics: 0.00033249179024440716 | Validation metrics: 0.0004192171336123438
03-05 15:31:52 - INFO - Train metrics: 0.0003243637198867057 | Validation metrics: 0.0004119465208137314
03-05 15:31:52 - INFO - Train metrics: 0.0003171314404843221 | Validation metrics: 0.00040530625905963884
03-05 15:31:52 - INFO - Train metrics: 0.0003104798492414172 | Validation metrics: 0.0003990773352643832
03-05 15:31:52 - INFO - Train metrics: 0.00030437880049793417 | Validation metrics: 0.0003932114403031654
03-05 15:31:52 - INFO - Train metrics: 0.00029884338856530013 | Validation metrics: 0.00038767736075878744
03-05 15:31:52 - INFO - Train metrics: 0.00029379749197377486 | Validation metrics: 0.0003824119272082103
03-05 15:31:52 - INFO - Train metrics: 0.00028910162095108856 | Validation metrics: 0.0003773498541741359
03-05 15:31:52 - INFO - Train metrics: 0.00028465868781768906 | Validation metrics: 0.0003724530761981515
03-05 15:31:52 - INFO - Train metrics: 0.0002804495749311209 | Validation metrics: 0.0003677051557895887
03-05 15:31:52 - INFO - Train metrics: 0.0002764754610329885 | Validation metrics: 0.00036309066821228373
03-05 15:31:52 - INFO - Train metrics: 0.0002727108363605998 | Validation metrics: 0.00035859923016025937
03-05 15:31:52 - INFO - Train metrics: 0.0002691259311966103 | Validation metrics: 0.00035422974862299407
03-05 15:31:52 - INFO - Train metrics: 0.00026571269479421503 | Validation metrics: 0.00034998039241099373
03-05 15:31:52 - INFO - Train metrics: 0.0002624695819515483 | Validation metrics: 0.00034584729159674185
03-05 15:31:52 - INFO - Train metrics: 0.0002593882911474465 | Validation metrics: 0.0003418321565447394
03-05 15:31:52 - INFO - Train metrics: 0.00025646447679343023 | Validation metrics: 0.0003379396897284408
03-05 15:31:52 - INFO - Train metrics: 0.0002536989928936273 | Validation metrics: 0.00033416999257028556
03-05 15:31:52 - INFO - Train metrics: 0.0002510901747672891 | Validation metrics: 0.000330526944993045
03-05 15:31:52 - INFO - Train metrics: 0.00024863722866032284 | Validation metrics: 0.000327015226833861
03-05 15:31:52 - INFO - Train metrics: 0.0002463404259896536 | Validation metrics: 0.00032363583115070605
03-05 15:31:52 - INFO - Train metrics: 0.00024419825594553624 | Validation metrics: 0.00032039175828392003
03-05 15:31:52 - INFO - Train metrics: 0.00024220862903341623 | Validation metrics: 0.0003172841044777835
03-05 15:31:52 - INFO - Train metrics: 0.00024036824594387193 | Validation metrics: 0.00031431254929618327
03-05 15:31:52 - INFO - Train metrics: 0.0002386716682724141 | Validation metrics: 0.00031147428025077615
03-05 15:31:52 - INFO - Train metrics: 0.00023711200461128872 | Validation metrics: 0.00030876641959008396
03-05 15:31:52 - INFO - Train metrics: 0.00023568033573058967 | Validation metrics: 0.00030618265766245927
03-05 15:31:52 - INFO - Train metrics: 0.00023436594908656715 | Validation metrics: 0.0003037164960823238
03-05 15:31:52 - INFO - Train metrics: 0.000233157133888675 | Validation metrics: 0.0003013576053416902
03-05 15:31:52 - INFO - Train metrics: 0.00023204047429225966 | Validation metrics: 0.00029909710759635675
03-05 15:31:52 - INFO - Train metrics: 0.00023100248785668466 | Validation metrics: 0.00029692384990571876
03-05 15:31:52 - INFO - Train metrics: 0.00023002945322001862 | Validation metrics: 0.0002948263380206143
03-05 15:31:52 - INFO - Train metrics: 0.0002291082281063201 | Validation metrics: 0.00029279333462872817
03-05 15:31:52 - INFO - Train metrics: 0.00022822651603780826 | Validation metrics: 0.0002908154806437328
03-05 15:31:52 - INFO - Train metrics: 0.00022737344990678151 | Validation metrics: 0.00028888224106695916
03-05 15:31:52 - INFO - Train metrics: 0.00022653955397287145 | Validation metrics: 0.0002869862708559429
03-05 15:31:52 - INFO - Train metrics: 0.0002257167291652439 | Validation metrics: 0.0002851200547549083
03-05 15:31:52 - INFO - Train metrics: 0.00022489894800037518 | Validation metrics: 0.00028327814211617363
03-05 15:31:52 - INFO - Train metrics: 0.00022408187415341106 | Validation metrics: 0.0002814565592379582
03-05 15:31:52 - INFO - Train metrics: 0.0002232625281288263 | Validation metrics: 0.0002796523539923282
03-05 15:31:52 - INFO - Train metrics: 0.00022243913794829182 | Validation metrics: 0.00027786450980306425
03-05 15:31:52 - INFO - Train metrics: 0.00022161140104867797 | Validation metrics: 0.0002760920112698593
03-05 15:31:52 - INFO - Train metrics: 0.00022078020265325904 | Validation metrics: 0.00027433611867676554
03-05 15:31:52 - INFO - Train metrics: 0.00021994727042814097 | Validation metrics: 0.0002725981102404984
03-05 15:31:52 - INFO - Train metrics: 0.00021911481509736755 | Validation metrics: 0.00027088052563773785
03-05 15:31:52 - INFO - Train metrics: 0.00021828675506499953 | Validation metrics: 0.00026918647162889065
03-05 15:31:52 - INFO - Train metrics: 0.00021746749135538384 | Validation metrics: 0.0002675206045328517
03-05 15:31:52 - INFO - Train metrics: 0.0002166627224109936 | Validation metrics: 0.0002658883985155497
03-05 15:31:52 - INFO - Train metrics: 0.00021587879855633902 | Validation metrics: 0.00026429637959650296
03-05 15:31:52 - INFO - Train metrics: 0.00021512550775972393 | Validation metrics: 0.00026275427962625116
03-05 15:31:52 - INFO - Train metrics: 0.00021441390794494137 | Validation metrics: 0.00026127258597901374
03-05 15:31:52 - INFO - Train metrics: 0.00021375862571975697 | Validation metrics: 0.0002598644629934558
03-05 15:31:52 - INFO - Train metrics: 0.00021317854053475065 | Validation metrics: 0.0002585481643568574
03-05 15:31:52 - INFO - Train metrics: 0.0002126998662975451 | Validation metrics: 0.00025734815757129
03-05 15:31:52 - INFO - Train metrics: 0.00021235704877738254 | Validation metrics: 0.000256295090146137
03-05 15:31:53 - INFO - Train metrics: 0.0002121955241960121 | Validation metrics: 0.0002554278606737051
03-05 15:31:53 - INFO - Train metrics: 0.00021227672767596678 | Validation metrics: 0.0002547989898088454
03-05 15:31:53 - INFO - Train metrics: 0.00021268243189955966 | Validation metrics: 0.00025447618570225783
03-05 15:31:53 - INFO - Train metrics: 0.0002135193335880901 | Validation metrics: 0.0002545448495757136
03-05 15:31:53 - INFO - Train metrics: 0.00021492327742318257 | Validation metrics: 0.000255109153445716
03-05 15:31:53 - INFO - Train metrics: 0.00021706231439253898 | Validation metrics: 0.00025629360879056456
03-05 15:31:53 - INFO - Train metrics: 0.0002201278408771068 | Validation metrics: 0.0002582307332877371
03-05 15:31:53 - INFO - Train metrics: 0.00022431682740725614 | Validation metrics: 0.0002610446994588005
03-05 15:31:53 - INFO - Train metrics: 0.0002297955023706599 | Validation metrics: 0.0002648190840975278
03-05 15:31:53 - INFO - Train metrics: 0.00023664010310531558 | Validation metrics: 0.00026955165414638217
03-05 15:31:53 - INFO - Train metrics: 0.0002447822127423546 | Validation metrics: 0.00027512353515685205
03-05 15:31:53 - INFO - Train metrics: 0.00025398479673934443 | Validation metrics: 0.00028130222544676123
03-05 15:31:53 - INFO - Train metrics: 0.0002639196538261341 | Validation metrics: 0.00028784401277362395
03-05 15:31:53 - INFO - Train metrics: 0.00027438151869831843 | Validation metrics: 0.00029469511355273426
03-05 15:31:53 - INFO - Train metrics: 0.0002855626845214152 | Validation metrics: 0.00030221357339560385
03-05 15:31:53 - INFO - Train metrics: 0.00029821925962000693 | Validation metrics: 0.00031125289564387816
03-05 15:31:53 - INFO - Train metrics: 0.00031338407452927814 | Validation metrics: 0.00032283527296826696
03-05 15:31:53 - INFO - Train metrics: 0.00033139983035406954 | Validation metrics: 0.00033726475014577085
03-05 15:31:53 - INFO - Train metrics: 0.0003503188489408776 | Validation metrics: 0.0003527518952114865
03-05 15:31:53 - INFO - Train metrics: 0.0003647925500684467 | Validation metrics: 0.00036454312956064113
03-05 15:31:53 - INFO - Train metrics: 0.00036755920650978995 | Validation metrics: 0.00036636173826256637
03-05 15:31:53 - INFO - Train metrics: 0.0003541648636057385 | Validation metrics: 0.0003545755068324694
03-05 15:31:53 - INFO - Train metrics: 0.0003271185808883919 | Validation metrics: 0.0003316244733698591
03-05 15:31:53 - INFO - Train metrics: 0.0002945210809619831 | Validation metrics: 0.0003045308765263833
03-05 15:31:53 - INFO - Train metrics: 0.00026452140469759947 | Validation metrics: 0.0002800251552458815
03-05 15:31:53 - INFO - Train metrics: 0.0002414656772813935 | Validation metrics: 0.0002614180022389675
03-05 15:31:53 - INFO - Train metrics: 0.0002259779284576323 | Validation metrics: 0.00024890370409455943
03-05 15:31:53 - INFO - Train metrics: 0.00021679106997506912 | Validation metrics: 0.00024124639957785756
03-05 15:31:53 - INFO - Train metrics: 0.0002122136211620275 | Validation metrics: 0.00023702893734232268
03-05 15:31:53 - INFO - Train metrics: 0.00021077468606146206 | Validation metrics: 0.00023512113539530247
03-05 15:31:53 - INFO - Train metrics: 0.00021135635189811248 | Validation metrics: 0.00023470183504002189
03-05 15:31:53 - INFO - Train metrics: 0.00021313486195824116 | Validation metrics: 0.00023515750518811847
03-05 15:31:53 - INFO - Train metrics: 0.000215482050726566 | Validation metrics: 0.00023599694902782863
03-05 15:31:53 - INFO - Train metrics: 0.000217875034919179 | Validation metrics: 0.00023679876867023232
03-05 15:31:53 - INFO - Train metrics: 0.00021986155567211063 | Validation metrics: 0.0002372140135978245
03-05 15:31:53 - INFO - Train metrics: 0.00022108214493767408 | Validation metrics: 0.0002369977918340627
03-05 15:31:53 - INFO - Train metrics: 0.00022134730975461055 | Validation metrics: 0.000236071389864641
03-05 15:31:53 - INFO - Train metrics: 0.00022070816615047892 | Validation metrics: 0.00023456261877788964
03-05 15:31:53 - INFO - Train metrics: 0.0002194810680575893 | Validation metrics: 0.0002327987305688286
03-05 15:31:53 - INFO - Train metrics: 0.0002181692249716416 | Validation metrics: 0.0002312204565951657
03-05 15:31:53 - INFO - Train metrics: 0.00021732215926268216 | Validation metrics: 0.00023025955864924448
03-05 15:31:53 - INFO - Train metrics: 0.00021737305956448015 | Validation metrics: 0.00023020948977162592
03-05 15:31:53 - INFO - Train metrics: 0.00021850067788366237 | Validation metrics: 0.00023112713178205822
03-05 15:31:53 - INFO - Train metrics: 0.00022056372234461255 | Validation metrics: 0.0002327966797777047
03-05 15:31:53 - INFO - Train metrics: 0.00022314149751573016 | Validation metrics: 0.00023479294384632146
03-05 15:31:53 - INFO - Train metrics: 0.00022566662859877708 | Validation metrics: 0.00023661308035235665
03-05 15:31:53 - INFO - Train metrics: 0.00022758349495003918 | Validation metrics: 0.00023781085261049672
03-05 15:31:53 - INFO - Train metrics: 0.00022847443377163802 | Validation metrics: 0.00023808588939389647
03-05 15:31:53 - INFO - Train metrics: 0.00022811525738226218 | Validation metrics: 0.00023730483489355656
03-05 15:31:53 - INFO - Train metrics: 0.0002264595864209951 | Validation metrics: 0.00023546733251405936
03-05 15:31:53 - INFO - Train metrics: 0.0002236023933972748 | Validation metrics: 0.00023267025068035406
03-05 15:31:53 - INFO - Train metrics: 0.00021971143556164723 | Validation metrics: 0.00022905226826263272
03-05 15:31:53 - INFO - Train metrics: 0.0002149882533293997 | Validation metrics: 0.00022476881559035093
03-05 15:31:53 - INFO - Train metrics: 0.00020962076455373363 | Validation metrics: 0.0002199620366533936
03-05 15:31:53 - INFO - Train metrics: 0.0002037690442774963 | Validation metrics: 0.00021475219112501075
03-05 15:31:53 - INFO - Train metrics: 0.00019756264557605632 | Validation metrics: 0.00020923910132195387
03-05 15:31:54 - INFO - Train metrics: 0.0001911076063956636 | Validation metrics: 0.00020350714498128968
03-05 15:31:54 - INFO - Train metrics: 0.0001845044175946016 | Validation metrics: 0.00019764032207824516
03-05 15:31:54 - INFO - Train metrics: 0.00017787362388329333 | Validation metrics: 0.00019174215552571108
03-05 15:31:54 - INFO - Train metrics: 0.00017137741368762299 | Validation metrics: 0.0001859527638045638
03-05 15:31:54 - INFO - Train metrics: 0.0001652512784999443 | Validation metrics: 0.00018047649181692513
03-05 15:31:54 - INFO - Train metrics: 0.00015981612178668576 | Validation metrics: 0.00017559195376551625
03-05 15:31:54 - INFO - Train metrics: 0.00015546184482915387 | Validation metrics: 0.0001716449400504129
03-05 15:31:54 - INFO - Train metrics: 0.00015257200084534475 | Validation metrics: 0.00016899773427120625
03-05 15:31:54 - INFO - Train metrics: 0.0001513801911833549 | Validation metrics: 0.0001679359339330477
03-05 15:31:54 - INFO - Train metrics: 0.00015179823772873226 | Validation metrics: 0.00016857335632643427
03-05 15:31:54 - INFO - Train metrics: 0.00015345464543997309 | Validation metrics: 0.0001709378952680231
03-05 15:31:54 - INFO - Train metrics: 0.00015633420508563809 | Validation metrics: 0.0001754806194139287
03-05 15:31:54 - INFO - Train metrics: 0.0001619825625653848 | Validation metrics: 0.00018375929159281606
03-05 15:31:54 - INFO - Train metrics: 0.00017353889339382907 | Validation metrics: 0.0001976411756436162
03-05 15:31:54 - INFO - Train metrics: 0.0001917531848640034 | Validation metrics: 0.0002151869298864363
03-05 15:31:54 - INFO - Train metrics: 0.00020884117344977863 | Validation metrics: 0.00022650357086512475
03-05 15:31:54 - INFO - Train metrics: 0.00021009840235904203 | Validation metrics: 0.00021877869636742305
03-05 15:31:54 - INFO - Train metrics: 0.00019038532343272933 | Validation metrics: 0.0001932422154538352
03-05 15:31:54 - INFO - Train metrics: 0.00017337515134128618 | Validation metrics: 0.00017773609469066176
03-05 15:31:54 - INFO - Train metrics: 0.00019457999250401082 | Validation metrics: 0.00020087733697216731
03-05 15:31:54 - INFO - Train metrics: 0.0002414735267814109 | Validation metrics: 0.00023914627128779285
03-05 15:31:54 - INFO - Train metrics: 0.00025481215043852393 | Validation metrics: 0.0002420276895546439
03-05 15:31:54 - INFO - Train metrics: 0.00022545410688519523 | Validation metrics: 0.00023200162398309042
03-05 15:31:54 - INFO - Train metrics: 0.00025319147311334255 | Validation metrics: 0.0003207192416396933
03-05 15:31:54 - INFO - Train metrics: 0.00037858362231149166 | Validation metrics: 0.0004919985055834092
03-05 15:31:54 - INFO - Train metrics: 0.00039604193934199766 | Validation metrics: 0.00047931524735612025
03-05 15:31:54 - INFO - Train metrics: 0.00023749874998700986 | Validation metrics: 0.0002624503071678595
03-05 15:31:54 - INFO - Train metrics: 0.00015381348844825343 | Validation metrics: 0.0001622499263671349
03-05 15:31:54 - INFO - Train metrics: 0.00016963676902387328 | Validation metrics: 0.00017971853326389923
03-05 15:31:54 - INFO - Train metrics: 0.0001613470183173078 | Validation metrics: 0.00017194794987756382
03-05 15:31:54 - INFO - Train metrics: 0.00015232390571673888 | Validation metrics: 0.00016863840250557082
03-05 15:31:54 - INFO - Train metrics: 0.00015794767352331074 | Validation metrics: 0.00017900049134928996
03-05 15:31:54 - INFO - Train metrics: 0.000165528602007354 | Validation metrics: 0.00018583928458886504
03-05 15:31:54 - INFO - Train metrics: 0.00017105493693668535 | Validation metrics: 0.00018794764250145302
03-05 15:31:54 - INFO - Train metrics: 0.00017573094590803967 | Validation metrics: 0.00018979170632482778
03-05 15:31:54 - INFO - Train metrics: 0.00018140262999848456 | Validation metrics: 0.00019375747834059475
03-05 15:31:54 - INFO - Train metrics: 0.00018943198610804415 | Validation metrics: 0.00020037503675510637
03-05 15:31:54 - INFO - Train metrics: 0.0002000248408292824 | Validation metrics: 0.00020928461236333608
03-05 15:31:54 - INFO - Train metrics: 0.00021266089397089271 | Validation metrics: 0.00021993634032292498
03-05 15:31:54 - INFO - Train metrics: 0.00022682504121413722 | Validation metrics: 0.000231918844163907
03-05 15:31:54 - INFO - Train metrics: 0.00024239856726869258 | Validation metrics: 0.0002450767782225151
03-05 15:31:54 - INFO - Train metrics: 0.0002595931571677215 | Validation metrics: 0.0002594763713517236
03-05 15:31:54 - INFO - Train metrics: 0.0002784323207885237 | Validation metrics: 0.00027507525572383946
03-05 15:31:54 - INFO - Train metrics: 0.0002979778878409462 | Validation metrics: 0.00029113212120578146
03-05 15:31:54 - INFO - Train metrics: 0.0003157084800313486 | Validation metrics: 0.000305680088014483
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.0003727685269867942

../_images/narx_neural_network_20_2.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:31:55 - INFO - Train metrics: 0.13982957450294853 | Validation metrics: 0.15204030034518
03-05 15:31:55 - INFO - Train metrics: 0.01442164420045184 | Validation metrics: 0.013174039057709953
03-05 15:31:55 - INFO - Train metrics: 0.02530220488931302 | Validation metrics: 0.0274371864142442
03-05 15:31:55 - INFO - Train metrics: 0.0032207567850477937 | Validation metrics: 0.003649139409941254
03-05 15:31:55 - INFO - Train metrics: 0.007245767812587713 | Validation metrics: 0.007285251051676695
03-05 15:31:55 - INFO - Train metrics: 0.002611650789172895 | Validation metrics: 0.0029910832262513313
03-05 15:31:55 - INFO - Train metrics: 0.003260353521763681 | Validation metrics: 0.00389312014849198
03-05 15:31:55 - INFO - Train metrics: 0.002331298379750367 | Validation metrics: 0.0027251050929830534
03-05 15:31:55 - INFO - Train metrics: 0.0021516779302864484 | Validation metrics: 0.0025460223991875396
03-05 15:31:55 - INFO - Train metrics: 0.0019697877811851506 | Validation metrics: 0.002428999739802546
03-05 15:31:55 - INFO - Train metrics: 0.0017572472844725674 | Validation metrics: 0.0022186186950126983
03-05 15:31:55 - INFO - Train metrics: 0.001633994165751943 | Validation metrics: 0.0020491707213975566
03-05 15:31:55 - INFO - Train metrics: 0.0015067548554082563 | Validation metrics: 0.0019362130169427456
03-05 15:31:55 - INFO - Train metrics: 0.0013917749905188505 | Validation metrics: 0.001816826221072162
03-05 15:31:55 - INFO - Train metrics: 0.0012888873496646048 | Validation metrics: 0.0016964564495014422
03-05 15:31:55 - INFO - Train metrics: 0.0011956068752205144 | Validation metrics: 0.0015856004367121542
03-05 15:31:55 - INFO - Train metrics: 0.001107340534439399 | Validation metrics: 0.0014864706641270055
03-05 15:31:55 - INFO - Train metrics: 0.0010278979005621171 | Validation metrics: 0.0013899502045747758
03-05 15:31:55 - INFO - Train metrics: 0.0009546084055224233 | Validation metrics: 0.0012986397892801147
03-05 15:31:55 - INFO - Train metrics: 0.0008882384555867143 | Validation metrics: 0.0012120890673344032
03-05 15:31:55 - INFO - Train metrics: 0.0008286782976573702 | Validation metrics: 0.001132997617153733
03-05 15:31:55 - INFO - Train metrics: 0.0007758429376081678 | Validation metrics: 0.0010601664632276604
03-05 15:31:55 - INFO - Train metrics: 0.0007300912853351381 | Validation metrics: 0.0009945574265932946
03-05 15:31:55 - INFO - Train metrics: 0.0006917565029620993 | Validation metrics: 0.0009362875363987052
03-05 15:31:55 - INFO - Train metrics: 0.0006609834235495325 | Validation metrics: 0.0008859560904892707
03-05 15:31:55 - INFO - Train metrics: 0.0006382582104650506 | Validation metrics: 0.0008441665659028322
03-05 15:31:55 - INFO - Train metrics: 0.0006237782880472473 | Validation metrics: 0.0008113654153985959
03-05 15:31:55 - INFO - Train metrics: 0.0006179160700777176 | Validation metrics: 0.0007879815800491758
03-05 15:31:55 - INFO - Train metrics: 0.000620593438811955 | Validation metrics: 0.0007742192576206618
03-05 15:31:55 - INFO - Train metrics: 0.0006311058093336198 | Validation metrics: 0.0007694803861515465
03-05 15:31:55 - INFO - Train metrics: 0.0006477429661643049 | Validation metrics: 0.0007723484916207993
03-05 15:31:55 - INFO - Train metrics: 0.0006674433835749433 | Validation metrics: 0.0007800467034820655
03-05 15:31:55 - INFO - Train metrics: 0.0006860939155328076 | Validation metrics: 0.0007887225482857438
03-05 15:31:55 - INFO - Train metrics: 0.0006988851110191833 | Validation metrics: 0.0007938311512892445
03-05 15:31:55 - INFO - Train metrics: 0.0007013753823875298 | Validation metrics: 0.0007910684810603282
03-05 15:31:55 - INFO - Train metrics: 0.0006904496387100048 | Validation metrics: 0.0007773283910185024
03-05 15:31:55 - INFO - Train metrics: 0.000665256262227034 | Validation metrics: 0.0007515912634471074
03-05 15:31:55 - INFO - Train metrics: 0.0006276636817994385 | Validation metrics: 0.0007153684296880407
03-05 15:31:55 - INFO - Train metrics: 0.0005820535594844878 | Validation metrics: 0.0006725142628772918
03-05 15:31:55 - INFO - Train metrics: 0.0005343600237108347 | Validation metrics: 0.0006283014492987833
03-05 15:31:55 - INFO - Train metrics: 0.000490457028439992 | Validation metrics: 0.0005879039568073973
03-05 15:31:55 - INFO - Train metrics: 0.0004544294769537255 | Validation metrics: 0.0005547640853410945
03-05 15:31:55 - INFO - Train metrics: 0.0004275439728406214 | Validation metrics: 0.0005296779693000846
03-05 15:31:55 - INFO - Train metrics: 0.00040856132408975156 | Validation metrics: 0.0005112038255020073
03-05 15:31:55 - INFO - Train metrics: 0.00039503696729968255 | Validation metrics: 0.0004970121333808309
03-05 15:31:55 - INFO - Train metrics: 0.0003845700110807165 | Validation metrics: 0.0004850966641867552
03-05 15:31:55 - INFO - Train metrics: 0.0003753901228196639 | Validation metrics: 0.00047418491261061094
03-05 15:31:55 - INFO - Train metrics: 0.0003665860552389763 | Validation metrics: 0.0004637088336172805
03-05 15:31:55 - INFO - Train metrics: 0.0003580973679981752 | Validation metrics: 0.000453646673416399
03-05 15:31:56 - INFO - Train metrics: 0.00035022852932427425 | Validation metrics: 0.0004441356462793368
03-05 15:31:56 - INFO - Train metrics: 0.00034307018306075986 | Validation metrics: 0.0004351472710212222
03-05 15:31:56 - INFO - Train metrics: 0.00033640954417367945 | Validation metrics: 0.0004265350518945717
03-05 15:31:56 - INFO - Train metrics: 0.0003300220564061444 | Validation metrics: 0.000418214488426468
03-05 15:31:56 - INFO - Train metrics: 0.0003238856225837031 | Validation metrics: 0.000410198510361064
03-05 15:31:56 - INFO - Train metrics: 0.00031806621182637576 | Validation metrics: 0.00040249046111112517
03-05 15:31:56 - INFO - Train metrics: 0.0003125414213330198 | Validation metrics: 0.0003950446429591852
03-05 15:31:56 - INFO - Train metrics: 0.0003072458187632851 | Validation metrics: 0.0003878317451142151
03-05 15:31:56 - INFO - Train metrics: 0.00030216930713037726 | Validation metrics: 0.0003808583700300354
03-05 15:31:56 - INFO - Train metrics: 0.0002973218143416947 | Validation metrics: 0.00037412140183291876
03-05 15:31:56 - INFO - Train metrics: 0.0002926873354787441 | Validation metrics: 0.00036760259095127833
03-05 15:31:56 - INFO - Train metrics: 0.00028825995560740133 | Validation metrics: 0.0003612950727028415
03-05 15:31:56 - INFO - Train metrics: 0.00028404179062719984 | Validation metrics: 0.00035519661638189594
03-05 15:31:56 - INFO - Train metrics: 0.00028002743787519673 | Validation metrics: 0.00034930527526556013
03-05 15:31:56 - INFO - Train metrics: 0.00027621725753864697 | Validation metrics: 0.0003436192005256548
03-05 15:31:56 - INFO - Train metrics: 0.0002726153733166761 | Validation metrics: 0.00033813776451896763
03-05 15:31:56 - INFO - Train metrics: 0.00026922419236594797 | Validation metrics: 0.0003328632220574137
03-05 15:31:56 - INFO - Train metrics: 0.0002660483823865092 | Validation metrics: 0.00032779770565802475
03-05 15:31:56 - INFO - Train metrics: 0.00026309324793440564 | Validation metrics: 0.00032294604596870037
03-05 15:31:56 - INFO - Train metrics: 0.00026036513743765726 | Validation metrics: 0.0003183132950028386
03-05 15:31:56 - INFO - Train metrics: 0.0002578706571740101 | Validation metrics: 0.0003139060158211964
03-05 15:31:56 - INFO - Train metrics: 0.0002556168329831969 | Validation metrics: 0.0003097315561120408
03-05 15:31:56 - INFO - Train metrics: 0.000253610306811568 | Validation metrics: 0.00030579750315577845
03-05 15:31:56 - INFO - Train metrics: 0.0002518568908180668 | Validation metrics: 0.0003021112240432301
03-05 15:31:56 - INFO - Train metrics: 0.00025036147481091975 | Validation metrics: 0.0002986802449073605
03-05 15:31:56 - INFO - Train metrics: 0.0002491267533379987 | Validation metrics: 0.0002955103835744802
03-05 15:31:56 - INFO - Train metrics: 0.00024815317200156006 | Validation metrics: 0.00029260633575654767
03-05 15:31:56 - INFO - Train metrics: 0.00024743896786807415 | Validation metrics: 0.00028997046738919437
03-05 15:31:56 - INFO - Train metrics: 0.0002469773145210474 | Validation metrics: 0.00028760151907030227
03-05 15:31:56 - INFO - Train metrics: 0.0002467597835203563 | Validation metrics: 0.00028549595777124093
03-05 15:31:56 - INFO - Train metrics: 0.0002467723670975774 | Validation metrics: 0.0002836458340306023
03-05 15:31:56 - INFO - Train metrics: 0.0002469979432285448 | Validation metrics: 0.0002820396535992246
03-05 15:31:56 - INFO - Train metrics: 0.0002474165932225171 | Validation metrics: 0.0002806625932201066
03-05 15:31:56 - INFO - Train metrics: 0.0002480047329837797 | Validation metrics: 0.0002794960223260627
03-05 15:31:56 - INFO - Train metrics: 0.00024873868147679196 | Validation metrics: 0.0002785201456087331
03-05 15:31:56 - INFO - Train metrics: 0.00024959394881294054 | Validation metrics: 0.0002777133359823075
03-05 15:31:56 - INFO - Train metrics: 0.0002505471242794809 | Validation metrics: 0.00027705410247282926
03-05 15:31:56 - INFO - Train metrics: 0.00025157781083248834 | Validation metrics: 0.0002765223152248772
03-05 15:31:56 - INFO - Train metrics: 0.0002526693564856 | Validation metrics: 0.00027610057073579444
03-05 15:31:56 - INFO - Train metrics: 0.0002538090559215119 | Validation metrics: 0.0002757743129746593
03-05 15:31:56 - INFO - Train metrics: 0.00025499127145837947 | Validation metrics: 0.0002755343651215574
03-05 15:31:56 - INFO - Train metrics: 0.00025621258824676236 | Validation metrics: 0.00027537337331468183
03-05 15:31:56 - INFO - Train metrics: 0.00025747782424708507 | Validation metrics: 0.0002752907766438456
03-05 15:31:56 - INFO - Train metrics: 0.00025879604023307056 | Validation metrics: 0.0002752897668291222
03-05 15:31:56 - INFO - Train metrics: 0.0002601770951090507 | Validation metrics: 0.00027537384691337746
03-05 15:31:56 - INFO - Train metrics: 0.00026163583540271285 | Validation metrics: 0.00027555222135046593
03-05 15:31:56 - INFO - Train metrics: 0.00026318855459082934 | Validation metrics: 0.0002758342836221511
03-05 15:31:56 - INFO - Train metrics: 0.00026485084444879644 | Validation metrics: 0.00027622968208919645
03-05 15:31:56 - INFO - Train metrics: 0.0002666342873528908 | Validation metrics: 0.0002767455901108645
03-05 15:31:56 - INFO - Train metrics: 0.0002685529247707078 | Validation metrics: 0.00027739153404701314
03-05 15:31:56 - INFO - Train metrics: 0.0002706085704033611 | Validation metrics: 0.00027816639354715894
03-05 15:31:56 - INFO - Train metrics: 0.00027279772157932545 | Validation metrics: 0.00027906682490455836
03-05 15:31:56 - INFO - Train metrics: 0.00027511033156879695 | Validation metrics: 0.00028008361102429906
03-05 15:31:56 - INFO - Train metrics: 0.00027751965752574045 | Validation metrics: 0.0002811953023833345
03-05 15:31:56 - INFO - Train metrics: 0.0002799868190668075 | Validation metrics: 0.00028237041187086944
03-05 15:31:56 - INFO - Train metrics: 0.00028245788869065206 | Validation metrics: 0.00028356739832558717
03-05 15:31:56 - INFO - Train metrics: 0.00028485995276777406 | Validation metrics: 0.00028472895953907736
03-05 15:31:56 - INFO - Train metrics: 0.00028710682843730115 | Validation metrics: 0.00028578789770659625
03-05 15:31:56 - INFO - Train metrics: 0.000289096933119069 | Validation metrics: 0.0002866658911866258
03-05 15:31:56 - INFO - Train metrics: 0.00029072243843419025 | Validation metrics: 0.0002872796545176757
03-05 15:31:56 - INFO - Train metrics: 0.00029187133657701666 | Validation metrics: 0.0002875428907267486
03-05 15:31:56 - INFO - Train metrics: 0.0002924410566771613 | Validation metrics: 0.00028737645532766527
03-05 15:31:56 - INFO - Train metrics: 0.00029234589546694794 | Validation metrics: 0.0002867141109420871
03-05 15:31:56 - INFO - Train metrics: 0.00029152915058809246 | Validation metrics: 0.0002855132416248171
03-05 15:31:56 - INFO - Train metrics: 0.00028996812287638695 | Validation metrics: 0.00028375539084369634
03-05 15:31:56 - INFO - Train metrics: 0.0002876783242358133 | Validation metrics: 0.0002814526610885455
03-05 15:31:56 - INFO - Train metrics: 0.0002847195485225157 | Validation metrics: 0.0002786503041120754
03-05 15:31:56 - INFO - Train metrics: 0.00028117569427491446 | Validation metrics: 0.0002754106106368279
03-05 15:31:57 - INFO - Train metrics: 0.00027715508609585333 | Validation metrics: 0.00027181483885141633
03-05 15:31:57 - INFO - Train metrics: 0.00027277357079774926 | Validation metrics: 0.0002679490940551264
03-05 15:31:57 - INFO - Train metrics: 0.0002681412586019162 | Validation metrics: 0.00026389457828675705
03-05 15:31:57 - INFO - Train metrics: 0.0002633488250815807 | Validation metrics: 0.0002597163333157736
03-05 15:31:57 - INFO - Train metrics: 0.000258462830915823 | Validation metrics: 0.0002554617337106417
03-05 15:31:57 - INFO - Train metrics: 0.0002535186476893443 | Validation metrics: 0.000251154930946991
03-05 15:31:57 - INFO - Train metrics: 0.0002485206697158338 | Validation metrics: 0.0002467964230236983
03-05 15:31:57 - INFO - Train metrics: 0.00024344641508862498 | Validation metrics: 0.00024236746589803711
03-05 15:31:57 - INFO - Train metrics: 0.00023825280233385522 | Validation metrics: 0.00023783519311403536
03-05 15:31:57 - INFO - Train metrics: 0.0002328874043292275 | Validation metrics: 0.00023316090657244051
03-05 15:31:57 - INFO - Train metrics: 0.00022730080193179405 | Validation metrics: 0.00022830920513822802
03-05 15:31:57 - INFO - Train metrics: 0.00022146429048581538 | Validation metrics: 0.00022326350771243486
03-05 15:31:57 - INFO - Train metrics: 0.00021538170761216366 | Validation metrics: 0.00021803216959321588
03-05 15:31:57 - INFO - Train metrics: 0.00020911095899215813 | Validation metrics: 0.00021266655713046966
03-05 15:31:57 - INFO - Train metrics: 0.00020278481002733635 | Validation metrics: 0.00020727670147093106
03-05 15:31:57 - INFO - Train metrics: 0.00019662196746937473 | Validation metrics: 0.00020203980643095242
03-05 15:31:57 - INFO - Train metrics: 0.00019093627338577761 | Validation metrics: 0.00019720614025830243
03-05 15:31:57 - INFO - Train metrics: 0.00018612589866692027 | Validation metrics: 0.00019309288752147684
03-05 15:31:57 - INFO - Train metrics: 0.00018262736258455283 | Validation metrics: 0.0001900487273962077
03-05 15:31:57 - INFO - Train metrics: 0.00018079886118849893 | Validation metrics: 0.00018836874244358354
03-05 15:31:57 - INFO - Train metrics: 0.00018071050954519312 | Validation metrics: 0.00018814445392115775
03-05 15:31:57 - INFO - Train metrics: 0.00018186352402000994 | Validation metrics: 0.00018907569579878879
03-05 15:31:57 - INFO - Train metrics: 0.00018304048795667348 | Validation metrics: 0.00019041695934837928
03-05 15:31:57 - INFO - Train metrics: 0.000182784057498319 | Validation metrics: 0.0001914199598067713
03-05 15:31:57 - INFO - Train metrics: 0.000181004575632844 | Validation metrics: 0.0001925271388961736
03-05 15:31:57 - INFO - Train metrics: 0.00018080574417146002 | Validation metrics: 0.00019628628444589788
03-05 15:31:57 - INFO - Train metrics: 0.00018704843870480836 | Validation metrics: 0.00020519528517998152
03-05 15:31:57 - INFO - Train metrics: 0.00019976730752540263 | Validation metrics: 0.00021619260319358095
03-05 15:31:57 - INFO - Train metrics: 0.00020943122330491657 | Validation metrics: 0.00021917245752352168
03-05 15:31:57 - INFO - Train metrics: 0.00020386805645695522 | Validation metrics: 0.00020630350921448847
03-05 15:31:57 - INFO - Train metrics: 0.0001865801561033274 | Validation metrics: 0.00018767178713607443
03-05 15:31:57 - INFO - Train metrics: 0.00019164438234562788 | Validation metrics: 0.0001974417611949541
03-05 15:31:57 - INFO - Train metrics: 0.0002533046076529984 | Validation metrics: 0.0002574686979936116
03-05 15:31:57 - INFO - Train metrics: 0.0003383898041747921 | Validation metrics: 0.00032403781237504023
03-05 15:31:57 - INFO - Train metrics: 0.0003708631938433083 | Validation metrics: 0.00033541934710522796
03-05 15:31:57 - INFO - Train metrics: 0.00032841831761970183 | Validation metrics: 0.0003016323604940841
03-05 15:31:57 - INFO - Train metrics: 0.000275406033160424 | Validation metrics: 0.0002981231999442433
03-05 15:31:57 - INFO - Train metrics: 0.00026230989685626396 | Validation metrics: 0.0003316608716785494
03-05 15:31:57 - INFO - Train metrics: 0.0002076346221870689 | Validation metrics: 0.00027281861232518397
03-05 15:31:57 - INFO - Train metrics: 0.00016242221111891544 | Validation metrics: 0.00019644252982959528
03-05 15:31:57 - INFO - Train metrics: 0.0002641409357926834 | Validation metrics: 0.00026932509140948756
03-05 15:31:57 - INFO - Train metrics: 0.00033829586634664494 | Validation metrics: 0.00032220965967457175
03-05 15:31:57 - INFO - Train metrics: 0.00029459326232743815 | Validation metrics: 0.000281911462691208
03-05 15:31:57 - INFO - Train metrics: 0.00022790826908003465 | Validation metrics: 0.00023352610643463906
03-05 15:31:57 - INFO - Train metrics: 0.00018921480030504133 | Validation metrics: 0.00020665757950734007
03-05 15:31:57 - INFO - Train metrics: 0.00017423073287480242 | Validation metrics: 0.00019359952288637444
03-05 15:31:57 - INFO - Train metrics: 0.00017313590760659054 | Validation metrics: 0.0001896088839993069
03-05 15:31:57 - INFO - Train metrics: 0.00017759236173043704 | Validation metrics: 0.00019054871562261587
03-05 15:31:57 - INFO - Train metrics: 0.00018201215658920415 | Validation metrics: 0.0001927629709090906
03-05 15:31:57 - INFO - Train metrics: 0.00018575376932238483 | Validation metrics: 0.00019538616882096223
03-05 15:31:57 - INFO - Train metrics: 0.00019052588114781038 | Validation metrics: 0.00019911772408640256
03-05 15:31:57 - INFO - Train metrics: 0.00019740227978667222 | Validation metrics: 0.00020447653022152607
03-05 15:31:57 - INFO - Train metrics: 0.00020627069269058373 | Validation metrics: 0.00021141348847639605
03-05 15:31:57 - INFO - Train metrics: 0.00021653894735774478 | Validation metrics: 0.00021962686694659896
03-05 15:31:57 - INFO - Train metrics: 0.00022787351757468875 | Validation metrics: 0.0002289360763641507
03-05 15:31:57 - INFO - Train metrics: 0.00024047131982181491 | Validation metrics: 0.0002394563235069691
03-05 15:31:57 - INFO - Train metrics: 0.0002547099354153471 | Validation metrics: 0.00025140296525528864
03-05 15:31:57 - INFO - Train metrics: 0.00027065203256116136 | Validation metrics: 0.00026476887763816524
03-05 15:31:57 - INFO - Train metrics: 0.0002877995637910707 | Validation metrics: 0.0002791402732713543
03-05 15:31:57 - INFO - Train metrics: 0.00030507205549001995 | Validation metrics: 0.00029364365124792766
03-05 15:31:57 - INFO - Train metrics: 0.0003208193368101049 | Validation metrics: 0.0003069337596176098
03-05 15:31:57 - INFO - Train metrics: 0.0003328674764927934 | Validation metrics: 0.00031723437867259063
03-05 15:31:57 - INFO - Train metrics: 0.00033889538796681604 | Validation metrics: 0.00032265452289427016
03-05 15:31:57 - INFO - Train metrics: 0.0003372852311657513 | Validation metrics: 0.00032186607925475323
03-05 15:31:57 - INFO - Train metrics: 0.0003280227075016971 | Validation metrics: 0.0003148053556379646
03-05 15:31:57 - INFO - Train metrics: 0.00031296871013164446 | Validation metrics: 0.0003028886828976072
03-05 15:31:57 - INFO - Train metrics: 0.00029515459527259223 | Validation metrics: 0.0002884792465001646
03-05 15:31:58 - INFO - Train metrics: 0.0002776018410170087 | Validation metrics: 0.00027398906255404304
03-05 15:31:58 - INFO - Train metrics: 0.00026244736259936223 | Validation metrics: 0.0002611965394338988
03-05 15:31:58 - INFO - Train metrics: 0.00025072004322930096 | Validation metrics: 0.0002510396800723604
03-05 15:31:58 - INFO - Train metrics: 0.00024259047161724726 | Validation metrics: 0.00024377118303402882
03-05 15:31:58 - INFO - Train metrics: 0.00023776674761324842 | Validation metrics: 0.00023924222161918126
03-05 15:31:58 - INFO - Train metrics: 0.00023578777915843644 | Validation metrics: 0.00023713001376958657
03-05 15:31:58 - INFO - Train metrics: 0.00023619774114842383 | Validation metrics: 0.00023708498397033022
03-05 15:31:58 - INFO - Train metrics: 0.0002385933894356526 | Validation metrics: 0.00023877986111781665
03-05 15:31:58 - INFO - Train metrics: 0.00024262562371967804 | Validation metrics: 0.00024192160697456336
03-05 15:31:58 - INFO - Train metrics: 0.00024797380961685497 | Validation metrics: 0.00024623621279853535
03-05 15:31:58 - INFO - Train metrics: 0.0002543132034139731 | Validation metrics: 0.00025144494797168956
03-05 15:31:58 - INFO - Train metrics: 0.00026130127844681966 | Validation metrics: 0.00025725406400548917
03-05 15:31:58 - INFO - Train metrics: 0.0002685513963454863 | Validation metrics: 0.0002633348325469691
03-05 15:31:58 - INFO - Train metrics: 0.00027563180663578565 | Validation metrics: 0.00026932116121646356
03-05 15:31:58 - INFO - Train metrics: 0.0002820871902844474 | Validation metrics: 0.0002748268851046121
03-05 15:31:58 - INFO - Train metrics: 0.00028745415128877196 | Validation metrics: 0.0002794607302569079
../_images/narx_neural_network_22_200.png