Source attribution¶
margam/ui/theme.py is adapted from src/geosampler/theme.py in GeoSampler,
revision c532cecec8777ee239e4c08bb41d7d922a82bc5c.
Source: https://github.com/praksharma/GeoSampler
Licence: AGPL-3.0-only; upstream licence text retained in assets/LICENSE-GEOSAMPLER.
GeoSampler attributes the application shell and theme palette to PyniteGUI:
https://github.com/praksharma/PyniteGUI
PyniteGUI source revision recorded upstream:
c421ec091b467da7e3955925622988bba36153a7, author Prakhar.
Adaptations rename the application theme property for Margam. The prototype uses these colours in its native Qt canvas, ports, connections and 2D preview. No Three.js, CAD fixture, or WebEngine code is copied.
The Hammersley and equal-volume recursive stratified algorithms in
margam/components/sampling.py are adapted from GeoSampler
src/geosampler/sampling.py, revision c532cecec8777ee239e4c08bb41d7d922a82bc5c,
AGPL-3.0-only. They are restricted to intervals/rectangles and do not import
GeoSampler, SciPy, Gmsh or any CAD/UI code. Existing Margam grid/random sequences
remain unchanged.
margam/ui/desktop_state.py follows GeoSampler's QSettings/saveState layout and
QLockFile-per-recovery-file patterns (app.py, recovery.py, same revision above).
The implementation is specific to Margam JSON model drafts; no CAD caches, worker
protocols or GeoSampler project payloads are copied.
The planar import adapter consumes the GeoSampler schema-v2 NPZ manifest contract
from src/geosampler/export.py at the same recorded revision. It is a Margam data
adapter; no CAD import, Gmsh worker or 3D viewport implementation is included.
PhysicsNeMo pointwise networks¶
The pointwise architecture adaptations in margam/nn/{pointwise,fourier,highway,
modified_fourier,multiscale_fourier,dgm,siren,multiplicative_filter}.py draw from
NVIDIA PhysicsNeMo/PhysicsNeMo Sym, Apache-2.0. Copyright notices are retained in
those files; the full Apache-2.0 text is retained in assets/LICENSE-PHYSICSNEMO.
No upstream NOTICE file was present in the inspected local repository root.
Inspected local source: physicsnemo/nn/module/{fourier_layers,siren_layers,
dgm_layers,fully_connected_layers}.py, revision
96b7cd1c75914c1d2a438937a4fd340c08bebe59 of
https://github.com/NVIDIA/physicsnemo .
Complete model equations were also checked against
physicsnemo/sym/models/{fourier_net,highway_fourier_net,modified_fourier_net,
multiscale_fourier_net,dgm,siren,multiplicative_filter_net}.py, revision
0c5f18c31d03d46ec0cc3ef4ccbf761a956dd38c of
https://github.com/NVIDIA/physicsnemo-sym .
Margam modifications: plain tensor pointwise I/O and fixed [0,1] domain scaling; shared network construction for scalar/u-v-p PINNs; Torch-only seeded frequency and Gamma sampling; bounded concrete UI settings; no key/dictionary Arch wrappers, weight normalisation, adaptive activation parameters, or PhysicsNeMo runtime. Smooth tanh/SiLU/sine activations are selectable where supported. The original Margam fully connected implementation and defaults are unchanged.
Gabor uses a softplus positive-width parameter and a direct sum of squared distances,
so trained widths stay positive and second derivatives remain finite at a filter
centre. These are explicit changes from the inspected upstream Gabor layer. The
shared pointwise and linear helpers implement only the subset used by these networks.
No FNO, AFNO, spectral operator, graph, convolutional or attention architecture was
imported. See docs/neural-networks.md for per-family contracts and differences.
Learning-rate annealing algorithm¶
margam/methods/learning_rate_annealing.py is an independent implementation of
Algorithm 1, equations (40)–(42), in S. Wang, Y. Teng and P. Perdikaris,
Understanding and mitigating gradient pathologies in physics-informed neural
networks, arXiv:2001.04536v1 (2020), supplied locally as LRA.pdf.
Authors' paper/repository.
No upstream code or proposed network architecture was copied. Margam's per-named
constraint grouping, existing static loss scales, gradient floor and coefficient
cap are documented in docs/lra-pinn.md; the v1 raw denominator and new-estimate
EMA convention are explicit.
The Helmholtz example in margam/templates/examples.py follows section 2.2,
equations (8)–(10), of the same supplied v1 paper. The authors'
Helmholtz2D.py
confirms the square domain, sine modes (1,4), forcing and k²=1. No TensorFlow
network or trainer code was copied. Margam uses its existing Fourier feature NN,
fixed samples, LRA guards and separate output/reference contracts.
Offline documentation search¶
assets/vendor/iframe-worker/shim.js and its LICENSE are unmodified files from
iframe-worker 1.0.4, MIT, distributed at
https://registry.npmjs.org/iframe-worker/-/iframe-worker-1.0.4.tgz . The local shim
supports Zensical search when opening built pages directly from disk; no CDN
request is needed. Zensical is an optional documentation-build dependency.
The local PyniteGUI manual inspired the organisation of Margam's user guide (task pages, contextual screenshots and separate reference navigation). No PyniteGUI code, prose or screenshots were copied for this documentation work.
Residual refinement reference (DeepXDE)¶
Margam's RAR sampler follows the greedy residual-based anchor refinement shown in DeepXDE's RAR demonstration. It is independently implemented; no DeepXDE code is copied or required at runtime. Margam's scheduled multi-point additions, fresh candidate pools and point cap are documented in docs/adaptive-sampling.md. See also the user-facing community-method catalogue.
PINN importance sampling and integral loss references (NVIDIA Modulus)¶
These PINN formulations are credited to NVIDIA Modulus / Modulus Sym as community implementation references, subsequently named PhysicsNeMo Sym. The links below identify the reference versions actually inspected. This credits the source project without claiming it invented importance sampling or integration.
Margam's independently written residual importance sampler was compared with
NVIDIA PhysicsNeMo Sym's DictImportanceSampledPointwiseIterableDataset and
theory documentation.
The upstream source
is Apache-2.0. No source was copied and the package is not required. Differences
in candidate pools, importance measures, schedules and integral/mean normalisation
are documented in docs/adaptive-sampling.md.
See also the user-facing community-method catalogue.
The optional integral-of-squared-error formulation was independently implemented
after inspecting PhysicsNeMo Sym's PointwiseLossNorm in
loss/loss.py.
No NVIDIA code was copied. This does not implement its separate IntegralLossNorm
for constraints on integrated quantities. See docs/integral-loss.md.
Original PINN Burgers benchmark¶
The physical setup in margam/templates/burgers.py is from Raissi, Perdikaris and
Karniadakis, Physics-informed neural networks: A deep learning framework for solving
forward and inverse problems involving nonlinear partial differential equations,
JCP 378 (2019), 686–707; authors' problem description.
No TensorFlow source or reference dataset is copied. Margam uses its existing
networks and Adam trainer with editable defaults; it does not reproduce the
paper's optimiser/budget/accuracy. See docs/burgers.md.
Expert’s Guide pipeline (Margam label: Expert PINN)¶
The independent implementation in margam/methods/expert.py and exponential row
factorization in margam/nn/weight_factorization.py use the mathematical algorithms
in Wang, Sankaran, Wang and Perdikaris, An Expert’s Guide to Training Physics-informed
Neural Networks, arXiv:2308.08468v1, supplied locally
as expertPINN.pdf. The paper is not redistributed. “Expert PINN” is Margam’s label.
The JAX-PI repository, inspected
at f944a0cd03c7f35a239955505d83bbdc5a07f831, has a Penn research-use licence with
restrictions on source/modification distribution. No JAX-PI code, configurations,
data or licence-covered modifications are copied into Margam. The source was
reviewed to identify differences; implementation is independently written from
the paper equations using existing Margam/PyTorch components. Network reuse from
NVIDIA remains separately attributed above. Scope, differences and deferred
components are documented in docs/expert-pinn.md.
Scale-PINN mathematical reference¶
margam/methods/scale.py independently implements the equations and Algorithm 1 in Chiu, Wong, Ooi, Wei, Fan and Ong, Scale-PINN: Learning Efficient Physics-Informed Neural Networks Through Sequential Correction, arXiv:2602.19475v1. The paper is not bundled. The authors’ repository, reviewed at 5ff8219d2604de8a57a5b7a9c7db9b435c5c3257, declares all rights reserved. No upstream code, notebooks, data or license-covered modifications are copied into Margam. Existing NVIDIA-derived networks retain their separate notices above. See docs/scale-pinn.md for implementation differences.