Metadata-Version: 2.4
Name: wiretorch
Version: 0.1.0b1
Summary: Neural network models built from connectomes, in PyTorch
Author: Rory Bedford
License-Expression: MIT
Project-URL: Documentation, https://wiretorch.readthedocs.io
Project-URL: Source, https://github.com/rory-bedford/wiretorch
Project-URL: Changelog, https://github.com/rory-bedford/wiretorch/blob/main/CHANGELOG.md
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.7.0
Requires-Dist: numpy<2.3,>=2.0
Requires-Dist: scipy>=1.16.3
Requires-Dist: pandas>=2.3.3
Requires-Dist: matplotlib>=3.10.7
Requires-Dist: pydantic>=2.12.3
Requires-Dist: toml>=0.10.2
Requires-Dist: tqdm>=4.67.1
Requires-Dist: zarr>=3.1.3
Requires-Dist: dask>=2025.11.0
Requires-Dist: cma>=4.0.0
Provides-Extra: wandb
Requires-Dist: wandb>=0.22.3; extra == "wandb"
Provides-Extra: cpu
Requires-Dist: torch>=2.7.0; extra == "cpu"
Provides-Extra: cu129
Requires-Dist: torch>=2.7.0; extra == "cu129"
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/rory-bedford/wiretorch/main/docs/_static/logo.png" alt="wiretorch" width="260">
</p>

<h1 align="center">wiretorch</h1>

<p align="center">
  <a href="https://wiretorch.readthedocs.io"><img src="https://readthedocs.org/projects/wiretorch/badge/?version=latest" alt="docs"></a>
  <a href="https://pypi.org/project/wiretorch/"><img src="https://img.shields.io/pypi/v/wiretorch.svg" alt="PyPI"></a>
  <a href="https://github.com/rory-bedford/wiretorch/actions/workflows/tests.yml"><img src="https://github.com/rory-bedford/wiretorch/actions/workflows/tests.yml/badge.svg" alt="tests"></a>
  <a href="https://codecov.io/gh/rory-bedford/wiretorch"><img src="https://codecov.io/gh/rory-bedford/wiretorch/graph/badge.svg" alt="coverage"></a>
  <a href="https://wiretorch.readthedocs.io/en/latest/performance.html"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/rory-bedford/wiretorch/main/docs/badges/inference.json" alt="inference speed"></a>
  <a href="https://wiretorch.readthedocs.io/en/latest/performance.html"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/rory-bedford/wiretorch/main/docs/badges/training.json" alt="training speed"></a>
  <a href="https://github.com/rory-bedford/wiretorch/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT license"></a>
</p>

wiretorch builds neural network models from connectomes in PyTorch. You give it a
wiring diagram and the cell type of each neuron, and it builds a network with exactly
that connectivity. The networks run on GPUs with custom kernels and are differentiable,
so they can be trained with any loss: matching recorded spikes, rates or calcium
signals, performing a task, or anything else you can write in PyTorch.

It supports a range of single-neuron models, including conductance- and current-based
spiking neurons and rate neurons. Weights can be fixed, scaled per cell-type pair,
factorised or learnt one by one, and physiological parameters such as time constants
and thresholds can be learnt too.

## Installation

Install [PyTorch](https://pytorch.org/get-started/locally/) first, choosing the CUDA
version your driver supports (`nvidia-smi` shows it), then wiretorch:

```bash
pip install torch --index-url https://download.pytorch.org/whl/cu129
pip install wiretorch            # or "wiretorch[wandb]" to log to Weights & Biases
```

Without the first step pip installs PyPI's default PyTorch, a CUDA 13 build that needs
a recent driver. The [installation guide](https://wiretorch.readthedocs.io/en/latest/getting-started/install.html)
explains how to choose, and which GPUs are supported.

```python
import wiretorch as wt
```

## Documentation

[wiretorch.readthedocs.io](https://wiretorch.readthedocs.io) has a
[quickstart](https://wiretorch.readthedocs.io/en/latest/getting-started/quickstart.html),
[tutorials](https://wiretorch.readthedocs.io/en/latest/tutorials/index.html) (a ring
attractor, a spiking network on a synthetic connectome, fitting connection strengths
and physiology), and the
[API reference](https://wiretorch.readthedocs.io/en/latest/api/index.html).
Setting up a development environment and running the tests is described under
[Development](https://wiretorch.readthedocs.io/en/latest/development.html).

wiretorch used to be called `connectome_snns`. That name still imports, with a
deprecation warning.
