Views
No views yet
redcl_stage1_best.pt / _ckpt.pt: Depth-Aware ReCL pre-trained MLP encoder (Vanderbilt).recl_cnn_s42_best.pt / _s123_ / _s777_: ReCL pre-trained CNN backbones.recon_no_strat_s42_best.pt: Unstratified ReCL pre-trained MLP encoder.eeg_redcl_best.pt / _ckpt.pt: ReCL pre-trained EEG MLP encoder.byol_stage1_best.pt / simclr_stage1_best.pt: SimCLR and BYOL baseline MLP checkpoints.ablation_cosine_s42_best.pt / ablation_mse_only_s42_best.pt: Ablation checkweights.1import torch
2from src.model import Encoder
3
4# 1. Initialize the MLP encoder model architecture
5encoder = Encoder(input_dim=256, embedding_dim=256)
6
7# 2. Load the state dictionary
8checkpoint = torch.load("redcl_stage1_best.pt", map_location="cpu")
9state_dict = checkpoint["model"] if "model" in checkpoint else checkpoint
10
11# Extract encoder state dict weights (removes the "encoder." module prefix if present)
12if any(k.startswith("encoder.") for k in state_dict.keys()):
13 state_dict = {k[len("encoder."):]: v for k, v in state_dict.items() if k.startswith("encoder.")}
14
15encoder.load_state_dict(state_dict)
16encoder.eval()
17print("✓ ReCL Encoder model loaded successfully!")