Skip to main content

Package to localize torch deep learning models

Project description

DeepLocalizer

PyPI - Version

Blog Post

Quickly find functional specialization in PyTorch models.

Extends The LLM Language Network: A Neuroscientific Approach for Identifying Causally Task-Relevant Units to other models and data.

Examples:

Task Usage

Tasks are just pandas dataframes with a data, positive, and validation columns. Each row is a different data point.

See face_data_viewer.ipynb to see a real example of a face localizer data (face images from CelebA vs. objects images from COCO).

What do the columns mean?

  • data is the data itself (eg text) or points to data (eg image filename)
  • positive is True for the task and False for the control (eg face images have True and control images have False)
  • validation is technically optional. If you want to notate some rows to only be used later on to test performance and not for the main localization, you can indicate a subset of the rows as True. The main dataset used for localization is then False.

Again see face_data_viewer.ipynb if you're still confused.

Library Usage

Install

uv add deeplocalizer

or

pip install deeplocalizer

API Usage

See resnet34_example.ipynb for doing localization on a torch model with a custom dataset/task.

TODO: better documentation.

Development

cd deeplocalizer # this git repo

Make sure to have https://docs.astral.sh/uv/ installed.

Install and Run

uv sync
uv run deeplocalizer/deeplocalizer.py

or run an example python notebook within the .env generated.

References

papers

code/datasets

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deeplocalizer-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deeplocalizer-0.0.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file deeplocalizer-0.0.2.tar.gz.

File metadata

  • Download URL: deeplocalizer-0.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for deeplocalizer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e011af598a5fd81fea6c09d856e6b74264a8ec8f8a3e3731e6186442a6a1e1e3
MD5 8dc3cc609ff9ca641dd5a915782de2ad
BLAKE2b-256 f585138253306dab602d1aadd1144309778fb00428782d4fb7236f38ca2c847a

See more details on using hashes here.

File details

Details for the file deeplocalizer-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for deeplocalizer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec33c6918aefc76487ecd9f90e234387609522463169df8b9ab9f8776808707c
MD5 3815f1b1d0f05d5b2578df4e0bac907f
BLAKE2b-256 6c36ec549394f9fce616b5c5bfe415c9b60e0bcfb2ffbab7184feab7b394868c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page