Skip to content

Whalefishin/MFG_SolnOperator

Repository files navigation

Unsupervised Solution Operator Learning for High Dimensional MFG

The official repository for the results and the source code used in the work:

Huang, Han, and Rongjie Lai. "Unsupervised solution operator learning for mean-field games." Journal of Computational Physics (2025): 114057. [arXiv]

Results

During inference, our method maps a MFG problem setup to its solution via a single forward pass computed in under 1 second. In constrast, traditional optimization methods take minutes while deep learning methods require hours due to the need for re-training.

Gaussian

result result result result

Gaussian Mixture

result result result result

MNIST

result result result result
result result result result

Sampling Invariance

We showcase trained models' consistent behavior on input samples of varying sizes; this demonstrates we are indeed parametrizing the MFG solution operator, a mapping between infinite dimensional spaces.

1024 samples 2048 samples 4096 samples
result result result
2106 samples 3510 samples 7020 samples
result result result

Crowd Motion

result result result result
result result result result

Path Planning

Conceptually, this example models a group of agents wishing to travel from a location at the top to one at the bottom. Meanwhile, they want to avoid the two obstacles in the middle and minimize the distances traveled.

result result result result
result result result result

Dependencies

Tested with Python 3.9 and PyTorch 1.13.

Experiments

One can run the expriments shown in the paper by calling python main_corr.py with different arguments. Each run creates a directory at ./results/<dataset name>/<experiment name> to store all the relevant information for plotting, etc.

The experiments are moderately memory intensive - interaction-free MFG uses around 6 to 10GB of VRAM, while MFG with interaction terms may require ~20GB. Try reducing the batch size or number of samples per distribution if you get OOM errors.

Gaussian

To run the experiment, do:

python main_corr.py --N_iter 50000 --exp_name d=2 --model MLP_MHT_Corr5 --h 2048 --n_MHT_heads 4 --dropout_p 0.1 --lbd_L 5e-3 --lr_scheduler cyclic --log_interval 100 --lr 3e-5 --B_dist 8 --B_sample 1024 --n_MHT 1 --MMD_kernel linear --MMD_comp old --dim 2 --dataset gaussian_gaussian_centered --n_landmk 8 

The same experiment can be done in different dimensions by changing --d.

Gaussian Mixture

To run the experiment, do:

python main_corr.py --N_iter 50000 --exp_name d=2 --model MLP_MHT_Corr4 --h 2048 --n_MHT_heads 4 --lbd_L 1e-3 --lr_scheduler cyclic --log_interval 100 --lr 3e-5 --B_dist 16 --B_sample 1024 --n_MHT 1 --MMD_kernel lap --dim 2 --dataset gaussian_gaussian_mixture --ggm_sigma_min 0.1 --ggm_sigma_max 0.8 

The same experiment can be done in different dimensions by changing --d.

MNIST

Run:

python main_corr.py --N_iter 200000 --exp_name mnist_example --dropout_p 0.1 --model MLP_MHT_Blocks_Corr --h 2048 --n_MHT_heads 4 --lbd_L 2e-2 --lr_scheduler cyclic --save_interval 50000 --log_interval 1000 --lr 3e-5 --B_dist 16 --MNIST_n_repeat 3 --n_MHT 2 --MMD_kernel multiscale --dim 2 --dataset MNIST --MNIST_noise 1e-2 --MNIST_single_digit false 

Crowd Motion

Run:

python main_corr.py --N_iter 100000 --exp_name MHTblock=2_SIMP_d=20_lap_L=1e-3_B=8 --repeated_concat_t true --MHT_res_link true --I_quad simp --L_quad FD4_simp --t_batch_num 10 --model MFG_op_net --h 2048 --n_MHT_heads 4 --lbd_L 1e-3 --lbd_I 1e0 --lr_scheduler cyclic --log_interval 1000 --lr 3e-5 --B_dist 8 --B_sample 256 --n_MHT 2 --MMD_kernel lap --dim 20 --dataset crowd_motion --n_landmk 6 --dropout_p 0 --plot_x_min -5 --plot_x_max 5 --plot_y_min -5 --plot_y_max 5 --save_interval 100000 --L_comp grid --I_comp grid --MMD_comp old 

Path Planning

Run:

python main_corr.py --N_iter 200000 --exp_name MHTblock=2_L=1e-3 --repeated_concat_t true --MHT_res_link true --I_quad simp --L_quad FD4_simp --t_batch_num 10 --model MFG_op_net --h 2048 --n_MHT_heads 4 --lbd_L 1e-3 --lbd_I 1e0 --lr_scheduler cyclic --log_interval 500 --lr 3e-5 --B_dist 4 --B_sample 256 --n_MHT 2 --MMD_kernel lap --dim 2 --dataset crowd_motion_two --n_landmk 6 --dropout_p 0 --plot_x_min -5 --plot_x_max 5 --plot_y_min -5 --plot_y_max 5 --save_interval 200000 --L_comp grid --I_comp grid --MMD_comp old 

One can play with --lbd_L, --lbd_I to control the relative weights on the transport and interaction costs, respectively. For example, making --lbd_I larger encourages the agents to stay further away from the obstacle.

About

An unsupervised framework for learning high dimensional mean-field game solution operators

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages