You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains the official implementation of the NeurIPS 2025 paper "Understanding and Improving Adversarial Robustness of Neural Probabilistic Circuits".
Environment Setup
To create the required environment, run:
conda env create -f environment.yml
Then activate it with:
conda activate rnpc
Dataset Preparation
Download the datasets from Google Drive – RNPC datasets, and save them in the root directory of this repository.
Some modifications are required to adapt the attacks for the attribute recognition model, which outputs predictions for multiple attributes. Specifically, replace the files pgd.py, pgdl2.py, and cwbs.py under adversarial-attacks-pytorch/torchattacks/attacks with the ones provided in our repository.
Training
cd visat-models/scripts
To train the attribute recognition model, run:
./train_attr.bash
To train the probabilistic circuit, please use the repository of the LearnSPN paper to generate the structure of the probabilistic circuit first, which is saved as a .txt file. Then, run: