1import torch
2from eigen_moe import HFEigenMoE
3
4model = HFEigenMoE.from_pretrained(
5 "anzheCheng/EMoE",
6 vit_model_name="vit_base_patch16_224",
7 num_classes=1000,
8 strict=False,
9)
10model.eval()
11
12x = torch.randn(1, 3, 224, 224)
13with torch.no_grad():
14 logits = model(x)
15print(logits.shape)
1model = HFEigenMoE.from_pretrained(
2 "anzheCheng/EMoE",
3 vit_model_name="vit_large_patch16_224.augreg_in21k_ft_in1k",
4 num_classes=1000,
5 checkpoint_filename="eigen_moe_vit_large_patch16_224.augreg_in21k_ft_in1k_imagenet1k.pth",
6 strict=False,
7)
1@article{cheng2026emoe,
2 title={EMoE: Eigenbasis-Guided Routing for Mixture-of-Experts},
3 author={Cheng, Anzhe and Duan, Shukai and Li, Shixuan and Yin, Chenzhong and Cheng, Mingxi and Nazarian, Shahin and Thompson, Paul and Bogdan, Paul},
4 journal={arXiv preprint arXiv:2601.12137},
5 year={2026}
6}