Skip to main content

HNO-Hammerstein

Hammerstein Neural Operator with Latent Dynamics for Magnetic Hysteresis

License: MIT Python 3.9+

This package implements a Neural Operator based on the classic Hammerstein structure, designed to model non-linear dynamic systems with memory, such as magnetic hysteresis.

Unlike traditional neural networks (DeepONet, FNO), the HNO architecture explicitly separates the static non-linearity (input) from the latent dynamics (memory), ensuring physical interpretability and generalization across different temporal resolutions.


Arquitetura / Architecture

Arquitetura HNO-Hammerstein

O fluxo de dados é:

  1. Não Linearidade Estática (Static Non-linearity): z(t) = N_theta(H(t))
  2. Contexto Global (Global Context): c = E_phi(z(t))
  3. Dinâmica Latente (Latent Dynamics): s(t) = Integrate(f_psi(s, z, c))
  4. Saída (Output): B(t) = G_omega(s(t), z(t))

Instalação / Installation

pip install hno-hammerstein

#Uso Rápido / Quick Start
import torch
from hno_hammerstein import HNOHammerstein

# Instancia a rede / Instantiate the network
model = HNOHammerstein(
    nonlinear_dim=32,
    context_dim=32,
    state_dim=64,
    hidden_dim=64,
    dropout=0.05
)

# Cria uma entrada fictícia / Create a dummy input: (batch=1, Nt=198, 1)
h = torch.randn(1, 198, 1)


## Treinamento / Training

```python
import numpy as np
from hno_hammerstein import HNOHammersteinTrainer

# Carregar dados (exemplo)
H = np.random.randn(100, 198)  # 100 curvas, 198 pontos
B = np.random.randn(100, 198)

# Criar o trainer
trainer = HNOHammersteinTrainer(
    nonlinear_dim=32,
    context_dim=32,
    state_dim=64,
    hidden_dim=64,
    patience=250,
)

# Treinar
history = trainer.fit(H, B, epochs=2000, save_path="meu_modelo.pth")

# Prever
B_pred = trainer.predict(H[:5])




#Licença / License
Este projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.
This project is licensed under the MIT License. See the LICENSE file for details.

#Citação / Citation
bibtex
@mastersthesis{freitas2026hno,
  title={Hammerstein Neural Operator (HNO): Um Novo Operador Neural para Modelagem de Histerese Magnética},
  authors={Freitas, Daniel,  Almeida, Luiz}
  school={Universidade Federal do ABC (UFABC)},
  year={2026}
}

Metadata

Release files for hno-hammerstein 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hno-hammerstein 0.1.1
File Size Uploaded Provenance Actions
hno_hammerstein-0.1.1.tar.gz 8.4 kB Without provenance Details for hno_hammerstein-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hno-hammerstein 0.1.1
File Interpreter ABI Platform Actions
hno_hammerstein-0.1.1-py3-none-any.whl Python 3 none any Details for hno_hammerstein-0.1.1-py3-none-any.whl

Total release size: 16.2 kB

Release files / hno_hammerstein-0.1.1.tar.gz

Download URL hno_hammerstein-0.1.1.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
38aab9e0faffffb35fd530763c97a4058a75ee601f71df1bbdeb33bbc660432f
BLAKE2b-256 checksum
How to use checksums
175483231608642bf8af45988576680b552236e04323b68f7fac88b2735b3406
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.4

Release files / hno_hammerstein-0.1.1-py3-none-any.whl

Download URL hno_hammerstein-0.1.1-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86e00fa413b4a0e07b8f6ae147d2d2fe8f817a59dff285e9642796271a15cac1
BLAKE2b-256 checksum
How to use checksums
2d7924b0bf1eb74da76ec1978c7d74539100a7eb7b4efafa372b3ff2a8b8a227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.4

Security for hno-hammerstein 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page