File size: 625 Bytes
21419ae | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | """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)
|