-
Notifications
You must be signed in to change notification settings - Fork 0
imalsky/Emulator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Atmospheric Profile Transformer Codebase Overview This codebase trains a FiLM-conditioned transformer model for atmospheric profile regression predicting net thermal and reflected fluxes from pressure-temperature profiles and global variables (e.g., orbital distance). It uses preprocessed data from PICASO radiative transfer simulations, focusing on efficiency for GPU training (e.g., A100) via normalized .npy shards. Goals: Emulate expensive radiative transfer computations with a fast neural surrogate. Support reproducible training with configurable normalization, model architecture, and hyperparameters. Enable inference via exported TorchScript models. Pipeline Data Generation (Optional): Use create_data.py to process input HDF5 profiles with PICASO, saving raw results to data/raw/ (e.g., picaso_results_1.h5). Preprocessing: Load raw HDF5, compute normalization stats from train split, normalize all data, and shard into .npy files in data/processed/. Skips if hash matches. Training: Load shards, train transformer with AMP/grad accumulation/early stopping, save best model and JIT export to models/<folder>/. Evaluation: Test on held-out shards, log metrics. Run via python src/main.py --config config/config.jsonc. Directory Structure src/: Core code. config/: Configuration files (e.g., config.jsonc). data/raw/: Raw HDF5 inputs. data/processed/: Normalized .npy shards and metadata. models/: Trained models, logs, and exports. testing/: (Future use for tests). Key Files src/utils.py: Config loading, logging, seeding, splits, hashing. src/normalizer.py: Computes/applies normalization (e.g., log-min-max, symlog). src/preprocess.py: Converts HDF5 to normalized shards. src/dataset.py: Loads shards, pads sequences. src/model.py: FiLM-transformer definition and JIT export. src/train.py: Training loop with optimizers/schedulers. src/hardware.py: Device detection. src/main.py: Pipeline orchestrator. create_data.py: Generates raw HDF5 from profiles (standalone). Setup Install dependencies: PyTorch, h5py, numpy, tqdm, etc. Ensure HDF5 files exist in data/raw/. Customize config/config.jsonc for your setup.
About
Radiative Transfer Emulator
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published