Download src/binaryforecast/core/model/factory.py from SPARK-LAB/ST-DTKD: direct link, hf CLI and curl.
- Browser
- Download file 625 Bytes
-
https://huggingface.co/SPARK-LAB/ST-DTKD/resolve/main/src/binaryforecast/core/model/factory.py
- Command line
-
hf download hf://SPARK-LAB/ST-DTKD/src/binaryforecast/core/model/factory.py
-
curl -L -o factory.py https://huggingface.co/SPARK-LAB/ST-DTKD/resolve/main/src/binaryforecast/core/model/factory.py
625 Bytes
| """Model construction shared by training, evaluation, caching and inference.""" | |
| from .cnn import SimpleLightCNN, SimpleLight3DCNNWithFeature | |
| from .mdt import MDTTeacher, MDTTeacher3D | |
| def build_model(modality, temporal=False): | |
| """Build a binary single-modality CNN without changing checkpoint keys.""" | |
| channels = {'HMI': 1, 'AIA': 3}[modality] | |
| return (SimpleLight3DCNNWithFeature if temporal else SimpleLightCNN)(channels, 2, 0.5) | |
| def build_mdt(temporal=False): | |
| """Build an MDT teacher with 128-dimensional projections and 64-D latents.""" | |
| return (MDTTeacher3D if temporal else MDTTeacher)(128, 64, 2) | |