-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ConsciousnessModel and AbstractReasoning classes; initialize cogn…
…ition progress tracking and update reporting format
- Loading branch information
1 parent
a8c2714
commit 9fa746e
Showing
11 changed files
with
97 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .consciousness_model import ConsciousnessModel | ||
from .abstract_reasoning import AbstractReasoning | ||
# ...import other models as needed... | ||
__all__ = ['ConsciousnessModel', 'AbstractReasoning'] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import sys | ||
import os | ||
import torch | ||
import matplotlib.pyplot as plt | ||
|
||
# Add the parent directory to the Python path | ||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
||
from models.consciousness_model import ConsciousnessModel | ||
|
||
def plot_cognition_progress(history): | ||
"""Plot the cognition progress over time.""" | ||
epochs = list(range(1, len(history) + 1)) | ||
|
||
# Handle both old and new format | ||
progress = [] | ||
for entry in history: | ||
if isinstance(entry, dict): | ||
# Try both potential keys | ||
if 'cognition_progress' in entry: | ||
progress.append(entry['cognition_progress']) | ||
elif 'total' in entry: | ||
progress.append(entry['total']) | ||
else: | ||
raise KeyError("Entry missing both 'cognition_progress' and 'total' keys") | ||
else: | ||
progress.append(float(entry)) # Handle direct numerical values | ||
|
||
plt.figure(figsize=(10, 5)) | ||
plt.plot(epochs, progress, marker='o', linestyle='-', color='b') | ||
plt.title('Cognition Progress Over Time') | ||
plt.xlabel('Epoch') | ||
plt.ylabel('Cognition Progress (%)') | ||
plt.grid(True) | ||
plt.savefig('cognition_progress.png') | ||
plt.show() | ||
|
||
def main(): | ||
# Initialize the model | ||
config = ConsciousnessModel.create_default_config() | ||
model = ConsciousnessModel(**config) | ||
|
||
# Define the metrics | ||
metrics = { | ||
'phi': 0.85, | ||
'coherence': 0.85, | ||
'stability': 0.85, | ||
'adaptability': 0.85, | ||
'memory_retention': 0.85, | ||
'emotional_coherence': 0.85, | ||
'decision_making_efficiency': 0.85 | ||
} | ||
|
||
# Calculate cognition progress | ||
model.calculate_cognition_progress(metrics) | ||
|
||
# Report cognition progress | ||
report = model.report_cognition_progress() | ||
print(report) | ||
|
||
# Plot cognition progress | ||
plot_cognition_progress(model.cognition_progress_history) | ||
|
||
if __name__ == "__main__": | ||
main() |
Binary file modified
BIN
+0 Bytes
(100%)
tests/unit/__pycache__/test_cognition_progress.cpython-310-pytest-8.3.4.pyc
Binary file not shown.