/ib-color-naming

API for the Zaslavsky et al. (2018) IB color naming model

Primary LanguageJupyter NotebookMIT LicenseMIT

IB Color Naming Model

Python package for accessing the color naming model from:

Noga Zaslavsky, Charles Kemp, Terry Regier, and Naftali Tishby (2018). Efficient compression in color naming and its evolution. PNAS, 115(31):7937–7942. https://doi.org/10.1073/pnas.1800521115

Efficient compression in color naming and its evolution

Usage

Run python main.py to see a simple demo. This demo shows how to load the model, plot the theoretical bound, evaluate new naming data (with respect to the WCS color naming grid), and plot mode maps.

Model

The model is composed of the following components:

  • pM — capacity-achieving prior over color chips
  • pU_M — speaker's mental representations, m(u)
  • betas — the values of β used for the reverse deterministic annealing schedule
  • IB_curve — the IB theoretical bound defined by Iβ(M;W) and Iβ(W;U)
  • qW_M — the optimal IB encoders (color naming systems) for each value of β

See the paper for more details on each component.

The class IBNamingModel allows easy access to the model, and implements useful functions for evaluating data.

Integrating in another project

If you'd like to use this model in your project, you can define this packge as a submodule by running the following command:

git submodule add https://github.com/nogazs/ib-color-naming.git ib_color_naming

In your python scrip, you can then import the model's module like this:

from ib_color_naming.src import ib_naming_model

Please don't forget to acknowledge this repo in your work (see citation details below).

Requirements

See requirements.txt

Citation

If you find this useful, please consider acknowledging this repo and citing the following paper:

@article{Zaslavsky2018efficient,
    author = {Zaslavsky, Noga and Kemp, Charles and Regier, Terry and Tishby, Naftali},
    title = {Efficient compression in color naming and its evolution},
    journal = {Proceedings of the National Academy of Sciences}
    volume = {115},
    number = {31},
    pages = {7937--7942},
    year = {2018},
    doi = {10.1073/pnas.1800521115},
    publisher = {National Academy of Sciences},
    issn = {0027-8424}
}

Link to repo: https://github.com/nogazs/ib-color-naming