Spaces:
Sleeping
Sleeping
TeleologyHI commited on
Commit ·
867f0a9
1
Parent(s): f669fe4
Update HIM implementation with consciousness framework
Browse files- src/model/__init__.py +1 -2
- src/model/consciousness_model.py +25 -0
src/model/__init__.py
CHANGED
|
@@ -1,3 +1,2 @@
|
|
| 1 |
from .him_model import HIMModel
|
| 2 |
-
from .consciousness_model import ConsciousnessModel
|
| 3 |
-
from .emotional_model import EmotionalModel
|
|
|
|
| 1 |
from .him_model import HIMModel
|
| 2 |
+
from .consciousness_model import ConsciousnessModel
|
|
|
src/model/consciousness_model.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Dict, Any
|
| 2 |
+
import torch
|
| 3 |
+
import torch.nn as nn
|
| 4 |
+
import numpy as np
|
| 5 |
+
|
| 6 |
+
class ConsciousnessModel(nn.Module):
|
| 7 |
+
def __init__(self, config: Dict[str, Any]):
|
| 8 |
+
super().__init__()
|
| 9 |
+
self.self_awareness = nn.Linear(768, 256)
|
| 10 |
+
self.meta_cognitive = nn.Linear(256, 128)
|
| 11 |
+
self.phenomenal = nn.Linear(128, 64)
|
| 12 |
+
self.integration = nn.Linear(64, 32)
|
| 13 |
+
|
| 14 |
+
def forward(self, x: torch.Tensor) -> Dict[str, Any]:
|
| 15 |
+
awareness = torch.relu(self.self_awareness(x))
|
| 16 |
+
meta = torch.relu(self.meta_cognitive(awareness))
|
| 17 |
+
phenomenal = torch.relu(self.phenomenal(meta))
|
| 18 |
+
integrated = self.integration(phenomenal)
|
| 19 |
+
|
| 20 |
+
return {
|
| 21 |
+
'awareness': awareness,
|
| 22 |
+
'meta_cognitive': meta,
|
| 23 |
+
'phenomenal': phenomenal,
|
| 24 |
+
'integrated': integrated
|
| 25 |
+
}
|