kiranchhatre / BEAM-Bayes-Opt

[LOD 2022] Parallel Bayesian Optimization of Multi-agent Systems

Home Page:https://github.com/kiranchhatre/BEAM-Bayes-Opt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parallel Bayesian Optimization of Agent-based Transportation Simulation

1Energy Technologies Area, Berkeley Lab 2Marain.ai (now BrightDrop)

MATSim (Multi-Agent Transport Simulation Toolkit) is an open source large-scale agent-based transportation planning project applied to various areas like road transport, public transport, freight transport, regional evacuation, etc. BEAM (Behavior, Energy, Autonomy, and Mobility) framework extends MAT- Sim to enable powerful and scalable analysis of urban transportation systems. The agents from the BEAM simulation exhibit ‘mode choice’ behavior based on multinomial logit model. In our study, we consider eight mode choices viz. bike, car, walk, ride hail, driving to transit, walking to transit, ride hail to transit, and ride hail pooling. The ‘alternative specific constants’ for each mode choice are critical hyperparameters in a configuration file related to a particular scenario un- der experimentation. We use the ‘Urbansim-10k’ BEAM scenario (with 10,000 population size) for all our experiments. Since these hyperparameters affect the simulation in complex ways, manual calibration methods are time consuming. We present a parallel Bayesian optimization method with early stopping rule to achieve fast convergence for the given multi-in-multi-out problem to its optimal configurations. Our model is based on an open source HpBandSter package. This approach combines hierarchy of several 1D Kernel Density Estimators (KDE) with a cheap evaluator (Hyperband, a single multidimensional KDE). Our model has also incorporated extrapolation based early stopping rule. With our model, we could achieve a 25% L1 norm for a large-scale BEAM simulation in fully au- tonomous manner. To the best of our knowledge, our work is the first of its kind applied to large-scale multi-agent transportation simulations. This work can be useful for surrogate modeling of scenarios with very large populations. You can find our paper here (accepted at LOD 2022).

Usage

  1. Clone our repo and initialize submodule HpBandSter (commit: 841db4b) and BEAM (commit: cda7c18)

    git clone https://github.com/kiranchhatre/BEAM-Bayes-Opt.git 
    cd BEAM-Bayes-Opt
    git submodule init
    git submodule update
  2. Install requirements

    conda env create --BEAMBayesOpt envname --file=environment.yml
    conda activate BEAMBayesOpt
  3. BEAM setup

    System requirements:

     1. Java Runtime Environment or Java Development Kit 1.8
     2. VIA vizualization app: https://simunto.com/via/
     3. Git-LFS: https://git-lfs.github.com/
     4. Gradle: https://gradle.org/install/
    

    Once done set up the Git-LFS configuration and install and test BEAM as follows:

    # Git-LFS configuration
    git lfs install
    git lfs env
    git lfs pull
    
    gradle classes # install BEAM
    
    ./gradlew :run -PappArgs="['--config', 'test/input/beamville/beam.conf']" # run BEAM on toy scenario
  4. HpBandSter setup

    cd BOHB/
    python setup.py develop --user
    
  5. Run BEAM calibration experiment

    • Change relevant config paths and BEAM scenario you'd like to optimize
    • Change scenario config file parameters as needed in beam/test/input/sf-light/sf-light-0.5k.conf
    • run python Bayesian-worker-optimizer/BeamOptimizer.py

Parallel runs are executed through Pyro from the HpBandSter implementation as follows:

import core.nameserver as hpns
NS = hpns.NameServer(run_id='BEAM', host='127.0.0.1', port=None)
NS.start()

    # Code

NS.shutdown()

More information for BEAM can be found in BEAM docs and for HpBandSter in a blogpost.

Citation

If you find our work useful for your research, please consider citing the paper:

@misc{https://doi.org/10.48550/arxiv.2207.05041,
  doi = {10.48550/ARXIV.2207.05041},
  url = {https://arxiv.org/abs/2207.05041},
  author = {Chhatre, Kiran and Feygin, Sidney and Sheppard, Colin and Waraich, Rashid},
  keywords = {Machine Learning (cs.LG), Multiagent Systems (cs.MA), FOS: Computer and information sciences, FOS: Computer and information sciences},
  title = {Parallel Bayesian Optimization of Agent-based Transportation Simulation},
  publisher = {arXiv},
  year = {2022},
  copyright = {Creative Commons Attribution Non Commercial Share Alike 4.0 International}
}

Acknowledgement

The authors would like to thank the BEAM team for technical support. The research is supported by Berkeley Lab fellowship and the German National Scholarship provided by the Hans Hermann Voss Foundation.


* Work was done as Berkeley Lab affiliate, now at KTH, Sweden

About

[LOD 2022] Parallel Bayesian Optimization of Multi-agent Systems

https://github.com/kiranchhatre/BEAM-Bayes-Opt


Languages

Language:Python 85.5%Language:Jupyter Notebook 14.5%