Fuzzy Tiling Activation (FTA) for PyTorch and JAX/Flax
Project description
FTA - Fuzzy Tiling Activation
FTA is a neural network activation function that converts each scalar input into a tiled vector with "soft" or "fuzzy" sparsity: between the fully active and fully inactive tiles are one or more partially active tiles. FTA has been shown to be robust and effective in a wide variety of deep reinforcement learning settings (including continual learning), typically beating ReLU and tanh (Pan, Banman & White (2021); Lazar (2025); Lazar, Vandergrift, White, & White (forthcoming, 2026)).
This implementation extends the original from Pan, Banman & White (2021) by adding an extra tile at the right end of the core tiling. This tile implements a ReLU-like function that is shifted so that the discontinuity (where the flat section and linear section meet) lands on the core tiling's right boundary.
Both PyTorch and JAX/Flax implementations are included.
Installation
# PyTorch only
pip install fuzzy-tiling-activation[torch]
# JAX / Flax only
pip install fuzzy-tiling-activation[jax]
# Both
pip install fuzzy-tiling-activation[torch,jax]
Quick start
FTA is used in the same way as any built-in activation function. Note that because it's one-to-many rather than one-to-one, it increases the output dimensionality of its layer by a factor of num_tiles + 1.
PyTorch
from fta.torch import FTA
activation = FTA(
bound=4.0,
spillover_base=2,
spillover_mode="derive_from_bound",
num_tiles=8,
)
# z has shape (batch, features)
out = activation(z) # shape: (batch, (num_tiles + 1) * features)
JAX / Flax
from fta.jax import FTA
activation = FTA(
bound=4.0,
spillover_base=2,
spillover_mode="derive_from_bound",
num_tiles=8,
)
params = activation.init(rng_key, z)
out = activation.apply(params, z)
Parameters
| Parameter | Description |
|---|---|
bound |
Upper bound of the tiling range (lower bound is -bound) |
spillover_base |
Controls sparsity — higher means less sparse |
spillover_mode |
How spillover_base is converted to the actual spillover: "derive_from_bound" uses bound / 2^spillover_base; "derive_from_tile_width" uses tile_width * 1.5^spillover_base; "raw" (or None) uses spillover_base directly |
tile_width |
Width of each tile (provide this or num_tiles) |
num_tiles |
Number of tiles (provide this or tile_width) |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fuzzy_tiling_activation-0.1.2.tar.gz.
File metadata
- Download URL: fuzzy_tiling_activation-0.1.2.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
987fe23d697d18b0dd873dfc7a9e5688ebb6ad75944ff6dbb007174ee8ad9d9b
|
|
| MD5 |
cdae2eedbad16dca711a854357c99c3e
|
|
| BLAKE2b-256 |
078d088f342772a234a87b9cfca0c103532822357370aa5772e7f229d59a1310
|
File details
Details for the file fuzzy_tiling_activation-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fuzzy_tiling_activation-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3edc9e2adef8d812462598044c923d23bf066b42018665c648a81baf43591097
|
|
| MD5 |
98460ddd5c7e41db49799e1d19c67c00
|
|
| BLAKE2b-256 |
9507eca72149b2e1a82517f9d90eead1b49a98afdf4c63a7fc5a77207acb2baf
|