Authors: Albert Saiapin, Kim Batselier
To address the scalability limitations of Gaussian process (GP) regression, several approximation techniques have been proposed. One such method is based on tensor networks, which utilizes an exponential number of basis functions without incurring exponential computational cost. However, extending this model to a fully probabilistic formulation introduces several design challenges. In particular, for tensor train (TT) models, it is unclear which TT-core should be treated in a Bayesian manner.
We introduce a Bayesian tensor train kernel machine that applies Laplace approximation to estimate the posterior distribution over a selected TT-core and employs variational inference (VI) for precision hyperparameters. Experiments show that core selection is largely independent of TT-ranks and feature structure, and that VI replaces cross-validation while offering up to 65× faster training. The method’s effectiveness is demonstrated on an inverse dynamics problem.
For ablation studies and real-data experiments, we use the following 7 UCI regression datasets (Dua and Graff, 2017) and industrial robot dataset (Weigand et al., 2022):
| Boston | Concrete | Energy | Kin8nm | Naval | Protein | Yacht | Robot Dynamics | |
|---|---|---|---|---|---|---|---|---|
| N | 506 | 1030 | 768 | 8192 | 11934 | 45730 | 308 | 43624 |
| D | 13 | 8 | 8 | 8 | 16 | 9 | 6 | 18 |
where N represents the number of samples and D denotes the data dimensionality.
We use conda package manager to install required python packages. Once conda is installed, run the following command (while in the root of the repository):
conda env create -f environment.ymlThis will create a new environment named bayes_env with all required packages already installed. You can install additional packages by running:
conda install <package name>In order to read and run Jupyter Notebooks you may follow either of two options:
- [recommended] using notebook-compatibility features of IDEs, e.g. via
pythonandjupyterextensions of VS Code. - install jupyter notebook packages:
either with
conda install jupyterlabor withconda install jupyter notebook
Instead of setting up a Conda environment manually, you can run the entire experiment inside a Docker container. This ensures full reproducibility and requires only Docker installed on your system.
ℹ️ Note: Depending on your Docker installation, you may need to prefix
all docker commands in this guide with sudo.
-
From the project root (where the
Dockerfileis located) build the Docker image:docker build -t la-ttkm-project . -
Run the container interactively:
docker run -it -v $(pwd)/experiments:/app/experiments --name la-ttkm la-ttkm-project -
You are all set to reproduce the Numerical Experiments! 🤗
-
Re-enter the same container:
docker start -ai la-ttkm
-
Cleaning up (optional):
- Remove the container:
docker rm la-ttkm
- Remove the image:
docker rmi la-ttkm-project
- Remove the container:
-
Activate the virtual environment:
conda activate bayes_env
-
Run:
python setup_project.py
to download all datasets and configure the project directories.
-
Once the setup script has completed, run:
cd experimentsThis folder contains three subdirectories, each corresponding to a distinct experiment described in the paper:
ablation_study,variational_inferenceandrobot_dynamics. -
ablation_study- Run:
cd ablation_study - Analyze: If
Dockerrunpython analysis.py. Otherwise, runanalysis.ipynbin VS Code using thebayes_envenvironment, or open it withjupyter labto generate figures stored inartifacts.
- Run:
-
variational_inference- Run:
cd variational_inference - Train:
Computes evaluation metrics for further comparison. These are stored in
python training.py 'all'artifacts/training_artifacts. Usepython training.py --helpto see all options (e.g., parallel/sequential mode andn_jobs). - Analyze: If
Dockerrunpython analysis.py. Otherwise, runanalysis.ipynbin VS Code using thebayes_envenvironment, or open it withjupyter labto generate the final table for comparison.
- Run:
-
robot_dynamics:- Run:
cd robot_dynamics - Train:
Computes evaluation metrics and predictions for further comparison. These are stored in
python training.py 'all'artifacts/training_artifacts. - Analyze: If
Dockerrunpython analysis.py. Otherwise, runanalysis.ipynbin VS Code using thebayes_envenvironment, or open it withjupyter labto generate the final table for comparison and generate figures stored inartifacts.
- Run:
If you find our work helpful, please consider citing the paper:
In Progress!