How lululxvi/deeponet works
Overall Project Type and Purpose
• Type: A research-oriented deep learning framework designed for learning nonlinear operators.
• Purpose: Demonstrate various applications of DeepONet (and related architectures such as CNNs or sequence-to-sequence models) to solve differential equations, including fractional derivatives, ODEs/PDEs, advection-diffusion, and even Hamiltonian-based integrators.
• Main use cases include generating datasets, training the neural network models (DeepONet, seq2seq, CNNs, etc.), and evaluating the trained models with metrics such as MSE.
Main Components
A. Data Generation & Preprocessing
• MATLAB-based Data Generation:
• In the “fractional” directory (e.g., Caputo_1D.m, Fractional_Lap_2D.m, Orthogonal_polynomials.m, etc.) used to generate training and test datasets.
• “matrix_for_frac_Lap.m”, “GJ_generate.m”, etc. for data preparation.
• Python-based Data Generation:
• In the “src” folder (e.g., deeponet_pde.py, sde.py, and various solver scripts like ADR_solver.py, ADVD_solver.py, CVC_solver.py).
• In “seq2seq” modules for generating datasets that feed into seq2seq experiments.
• Data Packaging and Compression:
• “datasets.py” in the fractional folder and related data modules in “seq2seq/learner/data”.
B. Neural Network Model Components & Learning Modules
• DeepONet Training Modules:
• “DeepONet_float32_batch.py” which trains models for fractional cases.
• “deeponet_pde.py” in src used for antiderivative experiments and other PDE setups.
• Alternative Architectures:
• “seq2seq/learner/nn/seq2seq.py” for sequence-to-sequence neural network training.
• Other NN modules in “seq2seq/learner/nn” (deeponet.py, fnn.py, hnn.py, sympnet.py) representing different architectures that may be used depending on the experimental case.
• Training Orchestration:
• “seq2seq/learner/brain.py” and “seq2seq/learner/utils.py” for supervision and training utilities.
• The integrator module (especially “seq2seq/learner/integrator/hamiltonian/stormer_verlet.py”) indicating support for time integration in dynamic systems.
C. Solvers & System Specifics
• In the “src” directory, you have solvers like ADR_solver.py, ADVD_solver.py, and CVC_solver.py that contribute simulation capabilities.
• “system.py” and “config.py” help to configure and manage overall simulation settings.
D. Infrastructure & Deployment
• Configuration and settings files (e.g., requirements.txt, config.py).
• Model saving and evaluation utilities (e.g., output log details, saving checkpoints in seq2seq/seq2seq_main.py and outputs/ folder).
Relationships and Interactions to Highlight
• Data Flow: Data Generation (MATLAB scripts or Python scripts) → Data Packaging (datasets.py or learner/data modules) → Neural Network Training (DeepONet modules in both fractional and seq2seq directories) → Model Evaluation & Prediction (logs, figures, output files).
• Cross-Language Interplay: Emphasize the integration between MATLAB-based preprocessing and Python-based training pipelines.
• Task Differentiation: Clarify separate branching for different experiments. For instance, one branch for fractional derivative modeling (using MATLAB scripts then Python model training) versus the seq2seq branch for ODE/PDE tasks.
• Optional Integration Points: Note that some experiments, such as CNN operators (via CNN_operator_alpha.py), have a separate data-to-training workflow that can be highlighted as an alternative pipeline.
Architectural Patterns & Design Principles
• Modularity: Each experimental case is broken into isolated modules (data generation, preprocessing, learning, evaluation) that can be swapped or extended.
• Separation of Concerns: The code separates solvers/simulators (in src) from model definition and training (in seq2seq and fractional folders).
• Hybrid Integration: The project leverages both MATLAB and Python environments, indicating a dual-language workflow.