Fix d_text=768->512 (CLIP-ViT-B/32 outputs 512, not 768). Verified end-to-end on CPU with real Pokemon data.
Browse files- LiRA_Training.ipynb +2 -2
LiRA_Training.ipynb
CHANGED
|
@@ -362,7 +362,7 @@
|
|
| 362 |
" 'small': {'d_model': 512, 'n_blocks': 16, 'd_state': 12, 'd_reason': 128, 'max_reason': 4, 'ffn_expand': 2.5, 'cross_every': 4, 'n_heads': 8},\n",
|
| 363 |
" }\n",
|
| 364 |
"\n",
|
| 365 |
-
" def __init__(self, config_name='tiny', in_ch=4, d_text=
|
| 366 |
" super().__init__()\n",
|
| 367 |
" c = self.CONFIGS[config_name]\n",
|
| 368 |
" d = c['d_model']\n",
|
|
@@ -439,7 +439,7 @@
|
|
| 439 |
" return x, reason_info\n",
|
| 440 |
"\n",
|
| 441 |
"\n",
|
| 442 |
-
"model = LiRAModel(MODEL_SIZE, in_ch=4, d_text=
|
| 443 |
"n_params = sum(p.numel() for p in model.parameters())\n",
|
| 444 |
"print(f\"\\n✅ LiRA-{MODEL_SIZE.capitalize()} created: {n_params/1e6:.1f}M parameters\")\n",
|
| 445 |
"print(f\" Model size (fp16): {n_params*2/1024**2:.0f} MB\")"
|
|
|
|
| 362 |
" 'small': {'d_model': 512, 'n_blocks': 16, 'd_state': 12, 'd_reason': 128, 'max_reason': 4, 'ffn_expand': 2.5, 'cross_every': 4, 'n_heads': 8},\n",
|
| 363 |
" }\n",
|
| 364 |
"\n",
|
| 365 |
+
" def __init__(self, config_name='tiny', in_ch=4, d_text=512, patch_size=2):\n",
|
| 366 |
" super().__init__()\n",
|
| 367 |
" c = self.CONFIGS[config_name]\n",
|
| 368 |
" d = c['d_model']\n",
|
|
|
|
| 439 |
" return x, reason_info\n",
|
| 440 |
"\n",
|
| 441 |
"\n",
|
| 442 |
+
"model = LiRAModel(MODEL_SIZE, in_ch=4, d_text=512, patch_size=2).to(device)\n",
|
| 443 |
"n_params = sum(p.numel() for p in model.parameters())\n",
|
| 444 |
"print(f\"\\n✅ LiRA-{MODEL_SIZE.capitalize()} created: {n_params/1e6:.1f}M parameters\")\n",
|
| 445 |
"print(f\" Model size (fp16): {n_params*2/1024**2:.0f} MB\")"
|