Views
No views yet
Academic [5] + Behavioral [5] + Activity [5]
↓ ↓ ↓
Encoder A Encoder B Encoder C
(5→128→64) (5→128→64) (5→128→64)
└──────────────┴───────────────┘
↓
CrossModalAttentionFusion
- Concat [64,64,64] → 192
- Per-modality attention scores
- Softmax → weights sum to 1.0
- Project 192 → 128
↓
unified_embedding [128]
attention_weights [3] ← explainability| Metric | Score |
|---|---|
| NT-Xent Loss | 0.5869 |
| Silhouette Score | 0.3310 |
| Adjusted Rand Index | 0.9989 |
1import torch
2from huggingface_hub import hf_hub_download
3from modeling_multimodal import MultiModalFramework
4
5# Load model
6model = MultiModalFramework.from_pretrained("YOUR_HF_USERNAME/multimodal-representation-framework")
7model.eval()
8
9# Example: single student
10academic = torch.tensor([[3.7, 92.0, 90.0, 85.0, 1.0]]) # gpa, attendance%, assignment%, exam_avg, late
11behavioral = torch.tensor([[5.0, 90.0, 6.0, 8.0, 2.0]]) # library, session_min, peer, forum, login_var
12activity = torch.tensor([[9000.0, 7.5, 60.0, 5.0, 62.0]]) # steps, sleep, active_min, sedentary, hr
13
14with torch.no_grad():
15 embedding, attn = model(academic, behavioral, activity)
16
17print(f"Embedding shape : {embedding.shape}") # [1, 128]
18print(f"Attn weights : {attn.numpy().round(3)}") # [academic, behavioral, activity]| This Model | Wearable Application |
|---|---|
| Academic modality | EEG signals |
| Behavioral modality | EMG signals |
| Activity modality | IMU + PPG |
| Student profiles | Human activity states |