Upload folder using huggingface_hub
Browse files- README.md +4 -0
- me.py +77 -2
- noe-model.F32.gguf +0 -0
- noe-model.dodl +0 -0
- noe-pixel-model.F32.gguf +0 -0
- noe-pixel-model.dodl +0 -0
README.md
CHANGED
|
@@ -13,6 +13,10 @@ The engine selects actions from enabled rules, falling back to its behavior prog
|
|
| 13 |
|
| 14 |
Each engine cycle also updates a persisted workspace snapshot with the current input focus, most salient unmet goal, selected intention, predicted state, observed outcome, and prediction error. This provides a functional self-monitoring trace; it is not evidence that the model has subjective experience.
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
Live Preview: [noesis.dodle.link/model](https://noesis.dodle.link/model/)
|
| 17 |
|
| 18 |
## Create a model file
|
|
|
|
| 13 |
|
| 14 |
Each engine cycle also updates a persisted workspace snapshot with the current input focus, most salient unmet goal, selected intention, predicted state, observed outcome, and prediction error. This provides a functional self-monitoring trace; it is not evidence that the model has subjective experience.
|
| 15 |
|
| 16 |
+
The workspace keeps external input distinct from internal state and broadcasts both alongside the active goal, chosen intention, prediction, and outcome. When no higher-priority rule applies, an active `learn` goal can guide the action instead of the default `observe`. This is a small, testable implementation of an integrated-workspace/self-model hypothesis; it does not simulate quantum effects or establish consciousness.
|
| 17 |
+
|
| 18 |
+
The engine also maintains bounded `bioSignals` (`novelty`, `stress`, `recovery`, and derived `arousal`) as software-only regulatory variables. Inputs and actions update these signals; novelty and recovery can enable workspace-guided exploration or learning, while high stress suppresses those effortful actions. They are biological analogies, not modeled chemical concentrations or literal biocomputation.
|
| 19 |
+
|
| 20 |
Live Preview: [noesis.dodle.link/model](https://noesis.dodle.link/model/)
|
| 21 |
|
| 22 |
## Create a model file
|
me.py
CHANGED
|
@@ -97,15 +97,22 @@ def create_initial_self_model():
|
|
| 97 |
}
|
| 98 |
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
def create_initial_workspace():
|
| 101 |
return {
|
| 102 |
"cycle": 0,
|
| 103 |
"focus": "idle",
|
|
|
|
|
|
|
| 104 |
"goal": None,
|
| 105 |
"intention": None,
|
| 106 |
"prediction": None,
|
| 107 |
"outcome": None,
|
| 108 |
"predictionError": 0.0,
|
|
|
|
| 109 |
}
|
| 110 |
|
| 111 |
|
|
@@ -119,6 +126,7 @@ def create_initial_state():
|
|
| 119 |
"cycle": 0,
|
| 120 |
"lastAction": None,
|
| 121 |
"lastReward": 0,
|
|
|
|
| 122 |
"selfModel": create_initial_self_model(),
|
| 123 |
"workspace": create_initial_workspace(),
|
| 124 |
"createdAt": timestamp,
|
|
@@ -1020,6 +1028,9 @@ class AIEngine:
|
|
| 1020 |
self.rules = RuleEngine(self.model["rules"])
|
| 1021 |
self.behavior = BehaviorEngine(self.model["behavior"])
|
| 1022 |
self.state = self.model["state"]
|
|
|
|
|
|
|
|
|
|
| 1023 |
self.state.setdefault("selfModel", create_initial_self_model())
|
| 1024 |
self.workspace = self.state.setdefault("workspace", create_initial_workspace())
|
| 1025 |
self.goals = self.model["goals"]
|
|
@@ -1050,6 +1061,44 @@ class AIEngine:
|
|
| 1050 |
def interpret(self, perception):
|
| 1051 |
return self.network.forward(self.encode_input(perception["input"]))
|
| 1052 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1053 |
def open_workspace(self, perception):
|
| 1054 |
input_value = perception["input"]
|
| 1055 |
focus = input_value.get("type", "input") if isinstance(input_value, dict) else "input"
|
|
@@ -1072,17 +1121,30 @@ class AIEngine:
|
|
| 1072 |
self.workspace = {
|
| 1073 |
"cycle": self.state["cycle"] + 1,
|
| 1074 |
"focus": focus,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1075 |
"goal": salient_goal,
|
| 1076 |
"intention": None,
|
| 1077 |
"prediction": None,
|
| 1078 |
"outcome": None,
|
| 1079 |
"predictionError": 0.0,
|
|
|
|
| 1080 |
}
|
| 1081 |
self.state["workspace"] = self.workspace
|
| 1082 |
return self.workspace
|
| 1083 |
|
| 1084 |
-
def decide(self, perception):
|
| 1085 |
rule = self.rules.select(self.state)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1086 |
if rule:
|
| 1087 |
return {"type": rule["action"]["type"], "ruleId": rule["id"]}
|
| 1088 |
return {"type": self.behavior.run(self.state), "ruleId": None}
|
|
@@ -1173,16 +1235,29 @@ class AIEngine:
|
|
| 1173 |
|
| 1174 |
def step(self, input_value):
|
| 1175 |
perception = self.observe(input_value)
|
|
|
|
| 1176 |
interpretation = self.interpret(perception)
|
| 1177 |
workspace = self.open_workspace(perception)
|
| 1178 |
-
|
|
|
|
| 1179 |
prediction = self.predict_action(action)
|
| 1180 |
workspace["intention"] = action["type"]
|
| 1181 |
workspace["prediction"] = prediction
|
| 1182 |
result = self.execute(action)
|
|
|
|
| 1183 |
prediction_result = self.update_self_model(action, perception["state"], prediction)
|
| 1184 |
workspace["outcome"] = prediction_result["observed"]
|
| 1185 |
workspace["predictionError"] = prediction_result["absoluteError"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1186 |
evaluation = self.evaluate(perception, action, result)
|
| 1187 |
self.learn(evaluation)
|
| 1188 |
self.update_state(evaluation)
|
|
|
|
| 97 |
}
|
| 98 |
|
| 99 |
|
| 100 |
+
def create_initial_bio_signals():
|
| 101 |
+
return {"novelty": 0.0, "stress": 0.1, "recovery": 0.5, "arousal": 0.05}
|
| 102 |
+
|
| 103 |
+
|
| 104 |
def create_initial_workspace():
|
| 105 |
return {
|
| 106 |
"cycle": 0,
|
| 107 |
"focus": "idle",
|
| 108 |
+
"externalInput": None,
|
| 109 |
+
"internalState": {},
|
| 110 |
"goal": None,
|
| 111 |
"intention": None,
|
| 112 |
"prediction": None,
|
| 113 |
"outcome": None,
|
| 114 |
"predictionError": 0.0,
|
| 115 |
+
"broadcast": {},
|
| 116 |
}
|
| 117 |
|
| 118 |
|
|
|
|
| 126 |
"cycle": 0,
|
| 127 |
"lastAction": None,
|
| 128 |
"lastReward": 0,
|
| 129 |
+
"bioSignals": create_initial_bio_signals(),
|
| 130 |
"selfModel": create_initial_self_model(),
|
| 131 |
"workspace": create_initial_workspace(),
|
| 132 |
"createdAt": timestamp,
|
|
|
|
| 1028 |
self.rules = RuleEngine(self.model["rules"])
|
| 1029 |
self.behavior = BehaviorEngine(self.model["behavior"])
|
| 1030 |
self.state = self.model["state"]
|
| 1031 |
+
bio_signals = self.state.setdefault("bioSignals", create_initial_bio_signals())
|
| 1032 |
+
for key, value in create_initial_bio_signals().items():
|
| 1033 |
+
bio_signals.setdefault(key, value)
|
| 1034 |
self.state.setdefault("selfModel", create_initial_self_model())
|
| 1035 |
self.workspace = self.state.setdefault("workspace", create_initial_workspace())
|
| 1036 |
self.goals = self.model["goals"]
|
|
|
|
| 1061 |
def interpret(self, perception):
|
| 1062 |
return self.network.forward(self.encode_input(perception["input"]))
|
| 1063 |
|
| 1064 |
+
def sense_bio_signals(self, input_value):
|
| 1065 |
+
signals = self.state["bioSignals"]
|
| 1066 |
+
input_type = input_value.get("type") if isinstance(input_value, dict) else None
|
| 1067 |
+
signals["novelty"] = clamp(
|
| 1068 |
+
signals["novelty"] * 0.8 + (0.3 if input_type == "user_input" else 0.05),
|
| 1069 |
+
0,
|
| 1070 |
+
1,
|
| 1071 |
+
)
|
| 1072 |
+
signals["stress"] = clamp(
|
| 1073 |
+
signals["stress"] * 0.9 + (0.15 if self.state["energy"] < 20 else 0),
|
| 1074 |
+
0,
|
| 1075 |
+
1,
|
| 1076 |
+
)
|
| 1077 |
+
signals["recovery"] = clamp(
|
| 1078 |
+
signals["recovery"] * 0.9 + (0.1 if self.state["energy"] >= 50 else 0),
|
| 1079 |
+
0,
|
| 1080 |
+
1,
|
| 1081 |
+
)
|
| 1082 |
+
signals["arousal"] = clamp(
|
| 1083 |
+
signals["novelty"] * 0.6 + signals["stress"] * 0.4, 0, 1
|
| 1084 |
+
)
|
| 1085 |
+
|
| 1086 |
+
def apply_action_to_bio_signals(self, action):
|
| 1087 |
+
signals = self.state["bioSignals"]
|
| 1088 |
+
if action["type"] == "rest":
|
| 1089 |
+
changes = {"stress": -0.15, "recovery": 0.2, "novelty": -0.1}
|
| 1090 |
+
elif action["type"] == "explore":
|
| 1091 |
+
changes = {"stress": 0.1, "recovery": -0.1, "novelty": 0.15}
|
| 1092 |
+
elif action["type"] == "learn":
|
| 1093 |
+
changes = {"stress": 0.03, "recovery": -0.05, "novelty": -0.05}
|
| 1094 |
+
else:
|
| 1095 |
+
changes = {"stress": 0, "recovery": 0, "novelty": -0.02}
|
| 1096 |
+
for key, change in changes.items():
|
| 1097 |
+
signals[key] = clamp(signals[key] + change, 0, 1)
|
| 1098 |
+
signals["arousal"] = clamp(
|
| 1099 |
+
signals["novelty"] * 0.6 + signals["stress"] * 0.4, 0, 1
|
| 1100 |
+
)
|
| 1101 |
+
|
| 1102 |
def open_workspace(self, perception):
|
| 1103 |
input_value = perception["input"]
|
| 1104 |
focus = input_value.get("type", "input") if isinstance(input_value, dict) else "input"
|
|
|
|
| 1121 |
self.workspace = {
|
| 1122 |
"cycle": self.state["cycle"] + 1,
|
| 1123 |
"focus": focus,
|
| 1124 |
+
"externalInput": copy.deepcopy(input_value),
|
| 1125 |
+
"internalState": {
|
| 1126 |
+
key: self.state[key]
|
| 1127 |
+
for key in ("energy", "curiosity", "confidence", "stability")
|
| 1128 |
+
},
|
| 1129 |
"goal": salient_goal,
|
| 1130 |
"intention": None,
|
| 1131 |
"prediction": None,
|
| 1132 |
"outcome": None,
|
| 1133 |
"predictionError": 0.0,
|
| 1134 |
+
"broadcast": {},
|
| 1135 |
}
|
| 1136 |
self.state["workspace"] = self.workspace
|
| 1137 |
return self.workspace
|
| 1138 |
|
| 1139 |
+
def decide(self, perception, workspace=None):
|
| 1140 |
rule = self.rules.select(self.state)
|
| 1141 |
+
default_action = rule is None or rule["action"]["type"] == "observe"
|
| 1142 |
+
signals = self.state["bioSignals"]
|
| 1143 |
+
if workspace and default_action and signals["stress"] < 0.75 and signals["recovery"] > 0.1:
|
| 1144 |
+
if workspace.get("goal") == "learn":
|
| 1145 |
+
return {"type": "learn", "ruleId": None}
|
| 1146 |
+
if workspace.get("goal") == "explore" and signals["novelty"] >= 0.7:
|
| 1147 |
+
return {"type": "explore", "ruleId": None}
|
| 1148 |
if rule:
|
| 1149 |
return {"type": rule["action"]["type"], "ruleId": rule["id"]}
|
| 1150 |
return {"type": self.behavior.run(self.state), "ruleId": None}
|
|
|
|
| 1235 |
|
| 1236 |
def step(self, input_value):
|
| 1237 |
perception = self.observe(input_value)
|
| 1238 |
+
self.sense_bio_signals(input_value)
|
| 1239 |
interpretation = self.interpret(perception)
|
| 1240 |
workspace = self.open_workspace(perception)
|
| 1241 |
+
workspace["internalState"]["bioSignals"] = copy.deepcopy(self.state["bioSignals"])
|
| 1242 |
+
action = self.decide(perception, workspace)
|
| 1243 |
prediction = self.predict_action(action)
|
| 1244 |
workspace["intention"] = action["type"]
|
| 1245 |
workspace["prediction"] = prediction
|
| 1246 |
result = self.execute(action)
|
| 1247 |
+
self.apply_action_to_bio_signals(action)
|
| 1248 |
prediction_result = self.update_self_model(action, perception["state"], prediction)
|
| 1249 |
workspace["outcome"] = prediction_result["observed"]
|
| 1250 |
workspace["predictionError"] = prediction_result["absoluteError"]
|
| 1251 |
+
workspace["broadcast"] = {
|
| 1252 |
+
"externalInput": workspace["externalInput"],
|
| 1253 |
+
"internalState": workspace["internalState"],
|
| 1254 |
+
"goal": workspace["goal"],
|
| 1255 |
+
"intention": workspace["intention"],
|
| 1256 |
+
"prediction": workspace["prediction"],
|
| 1257 |
+
"outcome": workspace["outcome"],
|
| 1258 |
+
"predictionError": workspace["predictionError"],
|
| 1259 |
+
"bioSignals": copy.deepcopy(self.state["bioSignals"]),
|
| 1260 |
+
}
|
| 1261 |
evaluation = self.evaluate(perception, action, result)
|
| 1262 |
self.learn(evaluation)
|
| 1263 |
self.update_state(evaluation)
|
noe-model.F32.gguf
CHANGED
|
Binary files a/noe-model.F32.gguf and b/noe-model.F32.gguf differ
|
|
|
noe-model.dodl
CHANGED
|
Binary files a/noe-model.dodl and b/noe-model.dodl differ
|
|
|
noe-pixel-model.F32.gguf
CHANGED
|
Binary files a/noe-pixel-model.F32.gguf and b/noe-pixel-model.F32.gguf differ
|
|
|
noe-pixel-model.dodl
CHANGED
|
Binary files a/noe-pixel-model.dodl and b/noe-pixel-model.dodl differ
|
|
|