"""
Functional API (PyTorch-like)
Similar to torch.nn.functional
"""
from .activations import (
    relu,
    gelu,
    silu,
    softmax,
    softplus,
)

from .linear import (
    linear,
)

from .normalization import (
    layer_norm,
)

from .dropout import (
    dropout,
)

from .attention import (
    attention,
    flash_attention2,
)

from .loss import (
    cross_entropy,
    binary_cross_entropy,
)

from .fft import (
    fft,
    ifft,
    fft_magnitude,
    fft_power_spectrum,
)

from .memory import (
    memory_read,
    memory_write,
    memory_context_aggregate,
    memory_query_pooling,
    memory_inject_concat,
    memory_inject_gate,
    memory_inject_residual,
)

from .cells import (
    place_cell,
    time_cell,
    theta_gamma_encoding,
)

from .learning import (
    fisher_info,
    ewc_penalty,
    natural_gradient,
    fisher_normalize,
    nlms_predict,
    nlms_update,
    nlms_ensemble,
    nlms_metrics,
    whitening_transform,
    whitening_apply,
    whitening_batch_stats,
)

from .bridge import (
    continuous_to_spikes,
    spikes_to_continuous,
    bridge_temporal_weights,
)

from .embedding import (
    embedding_lookup,
    embedding_normalize,
    embedding_position,
    embedding_pool,
    embedding_ffn,
    embedding_attention,
)

from .faiss import (
    faiss_distance,
    faiss_topk,
    faiss_ivf_filter,
    faiss_kmeans_update,
    faiss_quantize,
)

__all__ = [
    # Activations
    'relu',
    'gelu',
    'silu',
    'softmax',
    'softplus',
    # Linear
    'linear',
    # Normalization
    'layer_norm',
    # Dropout
    'dropout',
    # Attention
    'attention',
    'flash_attention2',
    # Loss
    'cross_entropy',
    'binary_cross_entropy',
    # FFT
    'fft',
    'ifft',
    'fft_magnitude',
    'fft_power_spectrum',
    # Memory
    'memory_read',
    'memory_write',
    'memory_context_aggregate',
    'memory_query_pooling',
    'memory_inject_concat',
    'memory_inject_gate',
    'memory_inject_residual',
    # Cells
    'place_cell',
    'time_cell',
    'theta_gamma_encoding',
    # Learning
    'fisher_info',
    'ewc_penalty',
    'natural_gradient',
    'fisher_normalize',
    'nlms_predict',
    'nlms_update',
    'nlms_ensemble',
    'nlms_metrics',
    'whitening_transform',
    'whitening_apply',
    'whitening_batch_stats',
    # Bridge
    'continuous_to_spikes',
    'spikes_to_continuous',
    'bridge_temporal_weights',
    # Embedding
    'embedding_lookup',
    'embedding_normalize',
    'embedding_position',
    'embedding_pool',
    'embedding_ffn',
    'embedding_attention',
    # FAISS
    'faiss_distance',
    'faiss_topk',
    'faiss_ivf_filter',
    'faiss_kmeans_update',
    'faiss_quantize',
]
