Introduction of Inductive_Biases_on_Shortcut_Learning
Model Details of Inductive_Biases_on_Shortcut_Learning
Inductive Biases on Shortcut Learning
A research codebase investigating how optimization-induced inductive biases (batch size, learning rate, and loss function) influence the tendency of deep networks to rely on shortcuts and the resulting group‑robustness of their predictions.
The goal of this project is to provide a
reliable
,
configurable
, and
reproducible
PyTorch pipeline that accompanies a paper exploring shortcut learning across several benchmark datasets.
🚀 Features
Datasets supported
: Waterbirds (WILDS), CelebA, Colored MNIST (CMNIST, automatically generated), with an optional domino‑style synthetic dataset for controlled experiments.
Model zoo
: ResNet‑18, ResNet‑50, a small convolutional network, and a simple multilayer perceptron (MLP).
Loss functions
: standard cross‑entropy, focal loss, label smoothing, and a gradient‑norm‑regularized objective used in the paper.
Evaluation metrics
: overall accuracy and worst‑group accuracy (WGA) following the group‑distributional robustness literature.
Reproducibility
: deterministic seeds, YAML configuration files, hyperparameter sweep scripts, CSV logging, and complete unit test coverage.
Extensible
: easy to plug in new datasets, architectures, or loss functions via the config system.
📁 Repository Structure
.
├── configs/ # yaml experiment configurations
├── data/ # dataset root (user provides raw files here)
├── models/ # model definitions and factory
├── paper/ # LaTeX source for the accompanying paper
├── scripts/ # main training/evaluation/sweep/analysis scripts
├── tests/ # unit and integration tests (pytest)
├── .github/workflows/ # continuous‑integration pipeline
└── requirements.txt # python dependencies
🛠️ Setup & Installation
This project targets Python 3.8+ and assumes a Unix‑like environment (Linux/macOS).
Create a virtual environment and activate it
python -m venv .venv
source .venv/bin/activate # or `.\.venv\Scripts\activate` on Windows
Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
# optional: `pip install torch torchvision` to install a specific CUDA build
(Optional) install extra packages for paper compilation and plotting
pip install matplotlib seaborn pandas pyyaml
📥 Data Preparation
Each dataset has slightly different requirements; place the raw files under
data/
as specified below.
Waterbirds (WILDS)
Download the dataset from
WILDS
or use the Kaggle mirror.
Place the extracted folder at
data/waterbirds/
. The directory should contain:
metadata.csv
with column
img_filename
pointing to image files.
the
images/
subdirectory with all bird photographs.
The CMNIST images are generated automatically when you run the training script; you do
not
need to download anything manually. The code uses torchvision's MNIST loader and adds random color correlations on the fly.
You can also pre‑download the base MNIST files for offline use:
The plotting utilities rely on
matplotlib
and
pandas
.
🧪 Testing
Run the full test suite (requires the virtual environment):
pytest -q
Unit tests cover data loaders, model factories, loss implementations, and basic training loops. New code should include corresponding tests to maintain >90% coverage.
📄 Paper
The narrative accompanying these experiments lives in
paper/main.tex
. To compile:
cd paper
pdflatex main.tex # or use your favorite LaTeX toolchain
Figures generated by the analysis scripts can be included by pointing LaTeX at
results/
.
🤝 Contributing
Contributions are welcome! A few guidelines:
Open an issue before adding large features to discuss design.
Follow the YAML configurability pattern when introducing new options.
Add tests for new functionality and ensure
pytest
passes.
Update this README with any new instructions or requirements.
📜 License
This repository is released under the MIT license. See
LICENSE
for details.
✨ Acknowledgements
This codebase was developed as part of the project described in the paper "Inductive Biases on Shortcut Learning" by [authors].
If you use this code in your research, please cite the paper accordingly. Feel free to contact the author(s) for questions or collaborations.
Runs of tahamajs Inductive_Biases_on_Shortcut_Learning on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About Inductive_Biases_on_Shortcut_Learning huggingface.co Model
Inductive_Biases_on_Shortcut_Learning huggingface.co is an AI model on huggingface.co that provides Inductive_Biases_on_Shortcut_Learning's model effect (), which can be used instantly with this tahamajs Inductive_Biases_on_Shortcut_Learning model. huggingface.co supports a free trial of the Inductive_Biases_on_Shortcut_Learning model, and also provides paid use of the Inductive_Biases_on_Shortcut_Learning. Support call Inductive_Biases_on_Shortcut_Learning model through api, including Node.js, Python, http.
Inductive_Biases_on_Shortcut_Learning huggingface.co is an online trial and call api platform, which integrates Inductive_Biases_on_Shortcut_Learning's modeling effects, including api services, and provides a free online trial of Inductive_Biases_on_Shortcut_Learning, you can try Inductive_Biases_on_Shortcut_Learning online for free by clicking the link below.
tahamajs Inductive_Biases_on_Shortcut_Learning online free url in huggingface.co:
Inductive_Biases_on_Shortcut_Learning is an open source model from GitHub that offers a free installation service, and any user can find Inductive_Biases_on_Shortcut_Learning on GitHub to install. At the same time, huggingface.co provides the effect of Inductive_Biases_on_Shortcut_Learning install, users can directly use Inductive_Biases_on_Shortcut_Learning installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Inductive_Biases_on_Shortcut_Learning install url in huggingface.co: