Skip to content

Commit af2249f

Browse files
committed
init
0 parents  commit af2249f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6473
-0
lines changed

.github/workflows/ruff.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Ruff
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
ruff:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
20+
- uses: astral-sh/ruff-action@v3
21+
with:
22+
args: "check --output-format=github --verbose"
23+
24+
# - name: Cache pip dependencies
25+
# uses: actions/cache@v3
26+
# with:
27+
# path: ~/.cache/pip
28+
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
29+
# restore-keys: |
30+
# ${{ runner.os }}-pip-
31+
32+
# - name: Install dependencies
33+
# run: |
34+
# pip install -r requirements.txt
35+
36+
# - name: Install SAE package
37+
# run: |
38+
# pip install .
39+
40+
# - name: Run ruff linter
41+
# run: |
42+
# ruff check --output-format=github --verbose
43+
44+
# - name: Run ruff formatter
45+
# run: |
46+
# ruff format --check --diff --verbose

.gitignore

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# Custom
2+
.DS_Store/
3+
checkpoints/
4+
checkpoints_raw/
5+
consistency_analysis/
6+
data/
7+
dummy_path/
8+
examples/dummy_stats_path/
9+
external/
10+
logs/
11+
out/
12+
wandb/
13+
*.zip
14+
*/backbone_cache/
15+
backbone_cache/
16+
*/checkpoints_test/
17+
hf-*/
18+
19+
# symlinks
20+
wandb
21+
checkpoints
22+
checkpoints_raw
23+
consistency_analysis
24+
data
25+
dummy_path
26+
logs
27+
out
28+
checkpoints*/
29+
ckpt*/
30+
31+
# Byte-compiled / optimized / DLL files
32+
__pycache__/
33+
*.py[codz]
34+
*$py.class
35+
36+
# C extensions
37+
*.so
38+
39+
# Distribution / packaging
40+
.Python
41+
build/
42+
develop-eggs/
43+
dist/
44+
downloads/
45+
eggs/
46+
.eggs/
47+
lib/
48+
lib64/
49+
parts/
50+
sdist/
51+
var/
52+
wheels/
53+
share/python-wheels/
54+
*.egg-info/
55+
.installed.cfg
56+
*.egg
57+
MANIFEST
58+
59+
# PyInstaller
60+
# Usually these files are written by a python script from a template
61+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
62+
*.manifest
63+
*.spec
64+
65+
# Installer logs
66+
pip-log.txt
67+
pip-delete-this-directory.txt
68+
69+
# Unit test / coverage reports
70+
htmlcov/
71+
.tox/
72+
.nox/
73+
.coverage
74+
.coverage.*
75+
.cache
76+
nosetests.xml
77+
coverage.xml
78+
*.cover
79+
*.py.cover
80+
.hypothesis/
81+
.pytest_cache/
82+
cover/
83+
84+
# Translations
85+
*.mo
86+
*.pot
87+
88+
# Django stuff:
89+
*.log
90+
local_settings.py
91+
db.sqlite3
92+
db.sqlite3-journal
93+
94+
# Flask stuff:
95+
instance/
96+
.webassets-cache
97+
98+
# Scrapy stuff:
99+
.scrapy
100+
101+
# Sphinx documentation
102+
docs/_build/
103+
104+
# PyBuilder
105+
.pybuilder/
106+
target/
107+
108+
# Jupyter Notebook
109+
.ipynb_checkpoints
110+
111+
# IPython
112+
profile_default/
113+
ipython_config.py
114+
115+
# pyenv
116+
# For a library or package, you might want to ignore these files since the code is
117+
# intended to run in multiple environments; otherwise, check them in:
118+
# .python-version
119+
120+
# pipenv
121+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
122+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
123+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
124+
# install all needed dependencies.
125+
# Pipfile.lock
126+
127+
# UV
128+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
129+
# This is especially recommended for binary packages to ensure reproducibility, and is more
130+
# commonly ignored for libraries.
131+
# uv.lock
132+
133+
# poetry
134+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
135+
# This is especially recommended for binary packages to ensure reproducibility, and is more
136+
# commonly ignored for libraries.
137+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
138+
# poetry.lock
139+
# poetry.toml
140+
141+
# pdm
142+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
143+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
144+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
145+
# pdm.lock
146+
# pdm.toml
147+
.pdm-python
148+
.pdm-build/
149+
150+
# pixi
151+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
152+
# pixi.lock
153+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
154+
# in the .venv directory. It is recommended not to include this directory in version control.
155+
.pixi
156+
157+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
158+
__pypackages__/
159+
160+
# Celery stuff
161+
celerybeat-schedule
162+
celerybeat.pid
163+
164+
# Redis
165+
*.rdb
166+
*.aof
167+
*.pid
168+
169+
# RabbitMQ
170+
mnesia/
171+
rabbitmq/
172+
rabbitmq-data/
173+
174+
# ActiveMQ
175+
activemq-data/
176+
177+
# SageMath parsed files
178+
*.sage.py
179+
180+
# Environments
181+
.env
182+
.envrc
183+
.venv
184+
env/
185+
venv/
186+
ENV/
187+
env.bak/
188+
venv.bak/
189+
190+
# Spyder project settings
191+
.spyderproject
192+
.spyproject
193+
194+
# Rope project settings
195+
.ropeproject
196+
197+
# mkdocs documentation
198+
/site
199+
200+
# mypy
201+
.mypy_cache/
202+
.dmypy.json
203+
dmypy.json
204+
205+
# Pyre type checker
206+
.pyre/
207+
208+
# pytype static type analyzer
209+
.pytype/
210+
211+
# Cython debug symbols
212+
cython_debug/
213+
214+
# PyCharm
215+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
216+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
217+
# and can be added to the global gitignore or merged into this file. For a more nuclear
218+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
219+
# .idea/
220+
221+
# Abstra
222+
# Abstra is an AI-powered process automation framework.
223+
# Ignore directories containing user credentials, local state, and settings.
224+
# Learn more at https://abstra.io/docs
225+
.abstra/
226+
227+
# Visual Studio Code
228+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
229+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
230+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
231+
# you could uncomment the following to ignore the entire vscode folder
232+
.vscode/
233+
234+
# Ruff stuff:
235+
.ruff_cache/
236+
237+
# PyPI configuration file
238+
.pypirc
239+
240+
# Marimo
241+
marimo/_static/
242+
marimo/_lsp/
243+
__marimo__/
244+
245+
# Streamlit
246+
.streamlit/secrets.toml

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: check-yaml
8+
- id: check-executables-have-shebangs
9+
- id: check-toml
10+
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.14.2
13+
hooks:
14+
# Run the linter.
15+
- id: ruff-check
16+
args: [ --fix]
17+
# Run the formatter.
18+
- id: ruff-format

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-2025 Hyesu Lim, Jinho Choi, Steffen Schneider, Paul Pommer, Tobias Schmidt, Lilly May
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NOTICE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## NOTICE
2+
3+
This repository is based on work originally developed in the [PatchSAE (ICLR 2025)](https://github.com/dynamical-inference/patchsae),
4+
and has been refactored and cleaned for public release.
5+
6+
We gratefully acknowledge the contributions and feedback from:
7+
- Collaborators and colleagues from [Dynamical Inference Lab](https://dynamical-inference.ai/) at Helmholtz Munich and KAIST.
8+
9+
This project builds upon and is inspired by the following open-source libraries and tools:
10+
- PyTorch (https://pytorch.org/)
11+
- Hugging Face Transformers (https://github.com/huggingface/transformers)
12+
- Code from PatchSAE (https://github.com/dynamical-inference/patchsae)
13+
14+
If you use this code, please also respect the licenses of the underlying dependencies and referenced projects.

0 commit comments

Comments
 (0)