Skip to content

A unified library to train Concept Bottleneck Models (CBMs) with state-of-the-art methods (Label-Free, VLG-CBM, LaBo, LM4CV, CB-LLM) and seamless concept integration.

Notifications You must be signed in to change notification settings

kaylaisher/cbm_library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concept Bottleneck Models benchmark Library

A unified training/evaluation toolkit for LF-CBM and VLG-CBM with ANEC metrics

  • Built with vllm pre-generated concept sets
  • Configs for different models training
  • Shared final layer training class
  • incroporate ANEC tool

Table of Contents

Setup

1) Clone

git clone https://github.com/kaylaisher/cbm_library.git
cd cbm_library

2) Install requirements

bash requirements.sh

training

Train LF-CBM

cd ..
python -m cbm_library.scripts.lf_cbm_train <dataset> \
  --save_dir saved_models \

Train VLG-CBM

cd ..
python -m cbm_library.scripts.vlg_cbm_train <dataset_name> \
  --annotation_dir /kayla/Annotations \
  --save_dir saved_models

Evaluate with ANEC tool

cd evaluation/ANEC-evaluator
pip install -e .
get_anec --load_path <path_to_your_data_folder> --output_dir <path_to_save_results>

Sources

We also build on GLM-SAGA for sparse final-layer training and related tooling.

Acknowledgement

This is a project of International Summer Research Program at UCSD. Developed by PIN-CI HUANG, National Central University. Under the supervision of Prof. Lily Weng and Ph.D Ge Yan.

About

A unified library to train Concept Bottleneck Models (CBMs) with state-of-the-art methods (Label-Free, VLG-CBM, LaBo, LM4CV, CB-LLM) and seamless concept integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published