%% MATLAB code accompanying 'A Diffusion Prior for Active Inference Planning', IWAI 2025

%CFHigham University of Glasgow February 2026

Requirements

Requires MATLAB R2024b or later.

Requires MATLAB's Deep Learning Toolbox
%@software{ Deep Learning Toolbox,
%year = {2024},
%author = {The MathWorks Inc.},
%title = { Deep Learning Toolbox: 24.2 (R2024b)}
%publisher = {The MathWorks Inc.},
%address = {Natick, Massachusetts, United States},
%url = {https://www.mathworks.com}
%}

The DDPM model was trained and the timing costs evaluated using an NVIDIA GeForce RTX 3090 GPU.


Contents

DefiningTrainingDDPM_Expt1&2.mlx : Denoising Diffusion Probabilistic Model (DDPM) example demonstrated for Experiments 1 and 2.

Expt2_Figure4.m : Code to recreate the results in Experiment 2

Expt3_Figure5.m : Code to recreate the results in Experiment 3

Expt3_active_inference_with_planning : Code to estimate the time (s) per policy

/Diffusion

Helper files for DDPM model

/Experiment1

data0513.mat : training data for Experiment 1
net0513.mat : pretrained net for Experiment 1

/Experiment2

data0508.mat : training data for Experiment 2
net0508.mat : pretrained net for Experiment 2
abcd0508.mat : saved results for Figure 4b
acbd0508.mat : saved resilts for Figure 4c
classdata0508 : classification data for Experiment 2

/Experiment3

Helper files for Experiment 3

    /DiffusionPriorTimings
    Saved timings





