complextorch
Copyright 2024-2026 Josiah W. Smith

This product includes software developed by Josiah W. Smith and contributors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this product except in compliance with the License. You may obtain a copy
of the License at:

    http://www.apache.org/licenses/LICENSE-2.0

------------------------------------------------------------------------------
Third-party components
------------------------------------------------------------------------------

The following third-party components have been incorporated into this project
under their original licenses. Their copyright notices are reproduced below as
required by their respective licenses. Each component remains licensed under
its original MIT terms within the files listed; the project as a whole is
distributed under Apache License 2.0.

------------------------------------------------------------------------------
Component: complexPyTorch
Source:    https://github.com/wavefrontshaping/complexPyTorch
License:   MIT
Files in this repository derived from or inspired by this component:
  - complextorch/nn/functional.py
      (apply_complex primitive; whitening batch_norm / layer_norm helpers)
  - complextorch/nn/modules/batchnorm.py
      (whitening BatchNorm*d; NaiveBatchNorm*d shares the split-real/imag pattern)
  - complextorch/nn/modules/dropout.py
      (Dropout1d/2d/3d — shared real/imag mask, Trabelsi 2018 pattern)

    Copyright (c) 2019 Sébastien M. P.

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.

------------------------------------------------------------------------------
Component: cplxmodule
Source:    https://github.com/ivannz/cplxmodule
License:   MIT
Files in this repository derived from or inspired by this component:
  - complextorch/nn/modules/casting.py
      (InterleavedToComplex, ConcatenatedToComplex, RealToComplex and inverses —
       replaces cplxmodule's AsTypeCplx / ConcatenatedRealToCplx family)
  - complextorch/nn/modules/pooling.py
      (MagMaxPool1d/2d/3d — magnitude-argmax pooling via torch.gather)
  - complextorch/nn/modules/activation/complex_relu.py
      (zAbsReLU, zLeakyReLU)
  - complextorch/nn/init.py
      (trabelsi_standard_, trabelsi_independent_)
  - complextorch/nn/relevance/  (entire subpackage)
      (BaseARD, ExpiFunction, LinearVD/ARD, BilinearVD/ARD, Conv*dVD/ARD,
       module-walking helpers)
  - complextorch/nn/masked/  (entire subpackage)
      (BaseMasked, MaskedWeightMixin, LinearMasked, BilinearMasked,
       Conv*dMasked, deploy_masks, binarize_masks, named_masks)
  - complextorch/nn/utils/sparsity.py
      (SparsityStats, named_sparsity, sparsity helpers)

    Copyright (c) 2019-present Ivan Nazarov

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.

------------------------------------------------------------------------------
Component: torchcvnn
Source:    https://github.com/torchcvnn/torchcvnn
License:   MIT
Files in this repository derived from or inspired by this component:
  - complextorch/nn/modules/attention/__init__.py
      (MultiheadAttention softmax_on='real' formulation; Hermitian QK^H fix
       cross-referenced against torchcvnn's implementation)
  - complextorch/nn/modules/transformer.py
      (TransformerEncoderLayer / Encoder / DecoderLayer / Decoder / Transformer)
  - complextorch/models/vit.py
      (ViTLayer, ViT, and the vit_t/s/b/l/h presets)
  - complextorch/nn/modules/upsampling.py
      (Upsample split form; PolarUpsample polar form)
  - complextorch/nn/modules/rmsnorm.py
      (complex RMSNorm)
  - complextorch/nn/modules/groupnorm.py
      (complex GroupNorm with per-group 2x2 whitening)
  - complextorch/nn/modules/activation/split_type_A.py
      (CVSplitELU/CELU, CVSplitCELU/CCELU, CVSplitGELU/CGELU)
  - complextorch/nn/modules/activation/split_type_B.py
      (AdaptiveModReLU; learnable-threshold modReLU extension)
  - complextorch/nn/modules/activation/fully_complex.py
      (Mod magnitude-extraction module)
  - complextorch/nn/modules/phase.py
      (PhaseShift learnable per-channel phase rotation)
  - complextorch/signal.py
      (pwelch — torch port of scipy.signal.welch)
  - complextorch/transforms/  (entire subpackage)
      (ToTensor, LogAmplitude, Amplitude, Normalize, RandomPhase, PadIfNeeded,
       CenterCrop, SpatialResize, FFT2/IFFT2, FFTResize, PolSAR, etc.)
  - complextorch/datasets/  (entire subpackage)
      (PolSFDataset, Bretigny, S1SLC, SLCDataset, MSTARTargets, ATRNetSTAR,
       SAMPLE, MICCAI2023, ALOSDataset and friends)

    Copyright (c) 2023 Jérémie Levi, Victor Dhédin, Jeremy Fix

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.
