This repository contains the different experimenets we did for the purpose of the AAAI paper (Building Modular Network models through the XMI).
PS: We do not include the XMI itself as this is a proprietary but the models and their parameters may be created from the code above.
We Mainly conducted three experimets:
This experiment will be found under QMI_pipeline_timing directory. We experimented with several testing files consisting of 50M rows with different combination of categorical and continuous features (the data generation process script is in dgp.py ) and compared the QMI (Queue Model Interface), the Tensorflows One Shot Iterator tf_records.py and the Pytorchs Dataloader pytorch_dataloader.py timings as we cycle through the data.
The following steps should allow you to run the experiment locally.
-
Install these requirements:
Python h5py numpy tensorflow torch
-
Open an IDE (for example Spider IDE).
-
Set the path of the data that will be generated in dgp.py.
-
Set the path of the generated data that will be used in tf_records.py and pytorch_dataloader.py.
-
Run the files and the results of the timings will be shown in the console.
This experiment will be found under Elect_model_vs_prophet. In this exepriment we used xmi_run_elec.py python script with the electrical demand data that will be found in elect_data.zip to generate 10 models, each one has it's own structure and configuration.
The output of the 10 trained models will be found under Elect_model_vs_prophet directory. Each zip file contains the output of a certain model, for example stlf1.zip
contains the output of model 1, stlf2.zip
is for model 2, etc...
Each zip file contains the following subfiles:
-
The model configuration (for example stlf.cfg): It contains the different parts that composes the structure of the model, from specifying the train and test datasets, defining the general parameters of the model(learning rate, number of iterations, loss function) to specifying the computational nodes like
node1
which takes an embedding layer and apply it for thelocation
categorical feature. This model configuration file will be created in every zip file under the name ofxmi.cfg
. -
The structure: the structure of the model is shown as a pdf graph. For example the structure of the first model
stlf1/graph.pdf
is shown as . The structure of the sixth modelstlf6/graph.pdf
is shown as . -
The model coefficients: Which represents the trained parameters for each node (each componenet of the model). For example
stlf1/coeffs/narx1_W.csv
file contains the weight matrixW
andstlf1/coeffs/narx1_b.csv
file contains the bias values and both of them are for thenode1
which is namednarx1
for the first modelstlf1
. -
The output of each node of the model: For example we have
stlf1/node_data/narx1.csv
file which contains the output ofnarx1
node for the first modelstlf1
-
The predictions: For example we have
stlf1/predictions.hdf5
file which contains the final output of the modelstlf1
for the train data. -
The forecasts: This file for example
stlf1/forecasts.hdf5
containes the final output of the modelstlf1
for the test data.
and so the models can be recreated exactly.
In addition, the Prophet model and timings code used is in train_prophet_models.py.
The evolution of the training algorithm are illustrated in an mp4 video located in Kernel_models directory. The output folder created by the xmi using run_3_kernels.py script is located in kernel3.zip and the model specification file is located in there as xmi.cfg
.