Metadata-Version: 2.4
Name: pystexa
Version: 0.0.1
Summary: A PyTorch library for explainable spatio-temporal architectures.
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/jgars/pystexa
Project-URL: Source, https://github.com/jgars/pystexa
Project-URL: Issues, https://github.com/jgars/pystexa/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.9.1
Dynamic: license-file

# PyStexa

PyStexa (Python Spatio-Temporal EXplainable Architectures) is a PyTorch library for explainable spatio-temporal architectures. It provides reusable neural network components that integrate with standard PyTorch workflows.

## Installation

PyStexa requires Python 3.10 or newer and PyTorch 2.9.1 or newer.

Install PyStexa from PyPI:

```bash
python -m pip install pystexa
```

## Example

The following example shows how a PyStexa component can be combined with standard PyTorch operations.

```python
import torch

from pystexa.nn.graph.masking import GlobalEdgeMask

mask_generator = GlobalEdgeMask(num_nodes=3)

adjacency = torch.tensor(
    [
        [0.0, 1.0, 0.5],
        [0.2, 0.0, 1.0],
        [1.0, 0.3, 0.0],
    ]
)
node_features = torch.randn(3, 2)

edge_mask = mask_generator()
masked_adjacency = adjacency * edge_mask
aggregated_features = masked_adjacency @ node_features

loss = aggregated_features.square().mean()
loss.backward()
```
