Skip to main content

A package for spherical positional encoding

Project description

Spherical-Implicit-Neural-Representation

Project Overview

Documentation Status

Spherical-Implicit-Neural-Representation unifies Fourier features (SIREN) [1], pure Spherical Harmonics (SphericalSirenNet) [3], and our learnable Herglotz‐map encodings [2] into a single PyTorch toolbox. Build implicit neural representations on:

  • $\mathbb{S}^2$ (HerglotzNet, SphericalSirenNet)
  • Volumetric data in $\mathbb{R}^3$ with radial basis (solid harmonics)
  • Generic ℝᵈ inputs via FourierPE, HerglotzPE

Coordinate conventions:

  • Angles: $\theta \in [0,\pi], \varphi ∈[0,2\pi)$ in radians.
  • Full spherical: $(r, \theta, \varphi)$.

📦 Installation

pip install spherical-inr

OR for development:

git clone https://github.com/yourusername/spherical_inr.git
cd spherical_inr
pip install -e .

🚀 Quickstart

import torch
from spherical_inr import HerglotzNet

# Create a HerglotzNet: harmonic order L → num_atoms=(L+1)**2
model = HerglotzNet(
    num_atoms = 50,                # spherical-harmonic degree
    mlp_sizes=[64,64],  # two hidden layers of width 64
    output_dim=1,       # scalar output per direction
)
# Random spherical angles (θ,φ)
x = torch.rand(16,2) * torch.tensor([torch.pi, 2*torch.pi])
y = model(x)

📚 References

  1. Sitzmann, M., Martel, J., Berg, R., Lindell, D. B., & Wetzstein, G. (2021). Implicit Neural Representations with Periodic Activation Functions (SIREN). Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2006.09661
  2. Hanon, T., et al. (2025). Herglotz-NET: Implicit Neural Representation of Spherical Data with Harmonic Positional Encoding. arXiv preprint arXiv:2502.13777. https://arxiv.org/abs/2502.13777
  3. Rußwurm, M., Klemmer, K., Rolf, E., Zbinden, R., & Tuia, D. (2024). Geographic Location Encoding with Spherical Harmonics and Sinusoidal Representation Networks. arXiv preprint arXiv:2310.06743. https://arxiv.org/abs/2310.06743

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spherical_inr-1.0.0a1.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spherical_inr-1.0.0a1-py3-none-any.whl (65.1 kB view details)

Uploaded Python 3

File details

Details for the file spherical_inr-1.0.0a1.tar.gz.

File metadata

  • Download URL: spherical_inr-1.0.0a1.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spherical_inr-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 d26dd2b8adb1fd75f70b4ae0ffd0c13bf552960563d8fae05b0e6c6afab6d727
MD5 8d82087db6417e3a9aa46b0ae2fc9686
BLAKE2b-256 1afff67a9b7b64d502dceadd0cea07d31e709a9ad5017fd93e459db550e64bde

See more details on using hashes here.

File details

Details for the file spherical_inr-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for spherical_inr-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a2ff125e6f51a63e1f3923ecbd7f95ddf5bb06671a00267cd32838a5424e659
MD5 dbd75e5238514bd3b3138cc90231ab42
BLAKE2b-256 deebcec5b7cd1df8f791c711bd13c2e4f800c1409592c6b86343b7b646efa342

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page