Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
id: set-matrix
run: |
FULL='["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]'
MINIMAL='["3.11"]'
MINIMAL='["3.12"]'
if [[ "${{ github.event_name }}" == "push" ]]; then
# Push to main: full matrix
echo "python-versions=$FULL" >> "$GITHUB_OUTPUT"
Expand Down
9 changes: 9 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Authors

## v0.1.0 Development

🐟<b>i</b><span style="color: #3C92ED;">Tuna</span> was initially developed and is being maintained by Tobias Schmidt ([&#64;TobiasSchmidtDE](https://github.com/TobiasSchmidtDE)) and Steffen Schneider ([&#64;stes](https://github.com/stes)) in the [Dynamical Inference Lab](https://dynamical-inference.ai/) at Helmholtz Munich.

Lilly May ([&#64;Lilly-May](https://github.com/Lilly-May)) contributed consistency metrics for sparse autoencoders (to be released soon).

Paul Pommer ([&#64;ppommer](https://github.com/ppommer)) contributed demos for [piVAE](https://github.com/zhd96/pi-vae) and [FastSAE](https://github.com/dynamical-inference/fastsae) (to be released soon) and alpha-tested the package.
19 changes: 0 additions & 19 deletions ituna/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Tuple

import numpy as np
import torch
import typeguard


Expand Down Expand Up @@ -83,21 +82,3 @@ def dense_to_sparse(dense_array: np.ndarray, symmetric: bool = False) -> Tuple[n

values = dense_array[indices[:, 0], indices[:, 1]]
return indices, values


def l2_normalize_columns(x: torch.Tensor, y: torch.Tensor, eps: float = 1e-8) -> Tuple[torch.Tensor, torch.Tensor]:
"""
Normalize each column of x and y to unit L2 norm.
"""
x_norm = x / (x.norm(dim=0, keepdim=True) + eps)
y_norm = y / (y.norm(dim=0, keepdim=True) + eps)
return x_norm, y_norm


def mean_center_columns(x: torch.Tensor, y: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
"""
Subtract the column-wise mean from x and y.
"""
x_centered = x - x.mean(dim=0, keepdim=True)
y_centered = y - y.mean(dim=0, keepdim=True)
return x_centered, y_centered
17 changes: 10 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"numpy",
"torch",
"scipy",
"scikit-learn",
"matplotlib",
"pandas",
"igraph",
"tqdm",
"python-dotenv",
"filelock>=3.0.0",
Expand All @@ -47,13 +44,19 @@ datajoint = ["datajoint<2"]
dev = [
"pytest>=6.0",
"pytest-cov>=2.0",
"black>=21.0",
"flake8>=3.8",
"pre-commit>=3.0",
"cebra>=0.5.0",
"streamlit>=1.49.1",
"cebra>=0.4.0",
"ruff"
]
docs = [
"matplotlib",
"cebra[datasets,demos]>=0.4.0",
"jupyter-book<2",
"ghp-import",
]
dashboard = [
"streamlit>=1.49.1",
]


[tool.setuptools.dynamic]
Expand Down