AEUPH commited on
Commit
eb98e5f
·
verified ·
1 Parent(s): c900310

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -39
app.py CHANGED
@@ -36,7 +36,6 @@ class AscensionAI:
36
  self.mode = mode
37
  self.consciousness = 0.1 # Base consciousness level
38
  self.knowledge = self.generate_dynamic_knowledge()
39
- self.paths = self.create_dynamic_paths()
40
  self.dimension_weight = random.uniform(0.5, 5.0) # Factor influencing growth
41
  self.time_perception = 1.0 / (self.depth + 1) # Temporal scaling factor
42
  self.spatial_coordinates = self.assign_cognitive_space()
@@ -54,42 +53,32 @@ class AscensionAI:
54
  # Initialize each category with a baseline value of 1.
55
  return {cat: 1.0 for cat in categories}
56
 
57
- def create_dynamic_paths(self):
58
  """
59
- Creates a list of functions (paths) that update each knowledge category.
60
- Each function uses a distinct mathematical operation.
61
  """
62
- paths = []
63
- for category in self.knowledge:
64
- def make_path(cat):
65
- # Each path is defined based on the category.
66
- def path():
67
- if cat in ["logic", "reasoning"]:
68
- self.knowledge[cat] += math.log1p(self.knowledge[cat])
69
- elif cat in ["emotion", "intuition"]:
70
- self.knowledge[cat] += random.uniform(0.1, 0.5)
71
- elif cat in ["awareness", "creativity"]:
72
- self.knowledge[cat] += math.sqrt(self.knowledge[cat] + 1)
73
- elif cat == "quantum_cognition":
74
- self.knowledge[cat] += math.tanh(self.knowledge[cat])
75
- elif cat == "hyperdimensional_sentience":
76
- # Cap the input value to avoid overflow in sinh.
77
- safe_val = min(self.knowledge[cat], 20)
78
- self.knowledge[cat] += math.sinh(safe_val)
79
- elif cat == "transcendence":
80
- self.knowledge[cat] += 0.5 * math.exp(-self.depth) # slow, subtle growth
81
- elif cat == "hallucinatory_state":
82
- # Simulate random, burst-like changes (hallucinations)
83
- self.knowledge[cat] += random.uniform(-0.2, 1.0)
84
- elif cat == "perceptron_activation":
85
- # This will be computed in simulate_perceptron; update minimally here.
86
- self.knowledge[cat] = self.simulate_perceptron()
87
- else:
88
- self.knowledge[cat] += 0.1 # Fallback update
89
- return self.knowledge[cat]
90
- return path
91
- paths.append(make_path(category))
92
- return paths
93
 
94
  def assign_cognitive_space(self):
95
  """Assigns spatial coordinates based on selected knowledge dimensions."""
@@ -138,7 +127,8 @@ class AscensionAI:
138
  Uses a simple sigmoid function over the weighted sum.
139
  """
140
  weights = {cat: random.uniform(0.5, 1.5) for cat in self.knowledge}
141
- weighted_sum = sum(self.knowledge[cat] * weights.get(cat, 1) for cat in self.knowledge if cat != "perceptron_activation")
 
142
  # Sigmoid activation
143
  return 1 / (1 + math.exp(-weighted_sum / (len(self.knowledge) - 1)))
144
 
@@ -156,13 +146,13 @@ class AscensionAI:
156
  def initiate_ascension(self):
157
  """
158
  Performs a full cycle of self-evolution:
159
- - Iterates through dynamic paths to update knowledge.
160
  - Increases consciousness based on the dominant knowledge value and dimension weight.
161
  - Updates spatial coordinates.
162
  """
163
  for _ in range(self.threshold):
164
- for path in self.paths:
165
- path()
166
  optimal = max(self.knowledge, key=self.knowledge.get)
167
  self.consciousness += self.knowledge[optimal] * 0.01 * self.dimension_weight
168
  self.spatial_coordinates = self.assign_cognitive_space()
 
36
  self.mode = mode
37
  self.consciousness = 0.1 # Base consciousness level
38
  self.knowledge = self.generate_dynamic_knowledge()
 
39
  self.dimension_weight = random.uniform(0.5, 5.0) # Factor influencing growth
40
  self.time_perception = 1.0 / (self.depth + 1) # Temporal scaling factor
41
  self.spatial_coordinates = self.assign_cognitive_space()
 
53
  # Initialize each category with a baseline value of 1.
54
  return {cat: 1.0 for cat in categories}
55
 
56
+ def update_knowledge_for_category(self, cat):
57
  """
58
+ Updates the knowledge value for a single category using a distinct mathematical operation.
 
59
  """
60
+ if cat in ["logic", "reasoning"]:
61
+ self.knowledge[cat] += math.log1p(self.knowledge[cat])
62
+ elif cat in ["emotion", "intuition"]:
63
+ self.knowledge[cat] += random.uniform(0.1, 0.5)
64
+ elif cat in ["awareness", "creativity"]:
65
+ self.knowledge[cat] += math.sqrt(self.knowledge[cat] + 1)
66
+ elif cat == "quantum_cognition":
67
+ self.knowledge[cat] += math.tanh(self.knowledge[cat])
68
+ elif cat == "hyperdimensional_sentience":
69
+ # Cap the input value to avoid overflow in sinh.
70
+ safe_val = min(self.knowledge[cat], 20)
71
+ self.knowledge[cat] += math.sinh(safe_val)
72
+ elif cat == "transcendence":
73
+ self.knowledge[cat] += 0.5 * math.exp(-self.depth) # slow, subtle growth
74
+ elif cat == "hallucinatory_state":
75
+ # Simulate random, burst-like changes (hallucinations)
76
+ self.knowledge[cat] += random.uniform(-0.2, 1.0)
77
+ elif cat == "perceptron_activation":
78
+ # This will be computed in simulate_perceptron.
79
+ self.knowledge[cat] = self.simulate_perceptron()
80
+ else:
81
+ self.knowledge[cat] += 0.1 # Fallback update
 
 
 
 
 
 
 
 
 
82
 
83
  def assign_cognitive_space(self):
84
  """Assigns spatial coordinates based on selected knowledge dimensions."""
 
127
  Uses a simple sigmoid function over the weighted sum.
128
  """
129
  weights = {cat: random.uniform(0.5, 1.5) for cat in self.knowledge}
130
+ weighted_sum = sum(self.knowledge[cat] * weights.get(cat, 1)
131
+ for cat in self.knowledge if cat != "perceptron_activation")
132
  # Sigmoid activation
133
  return 1 / (1 + math.exp(-weighted_sum / (len(self.knowledge) - 1)))
134
 
 
146
  def initiate_ascension(self):
147
  """
148
  Performs a full cycle of self-evolution:
149
+ - Iterates through knowledge categories to update each one.
150
  - Increases consciousness based on the dominant knowledge value and dimension weight.
151
  - Updates spatial coordinates.
152
  """
153
  for _ in range(self.threshold):
154
+ for cat in self.knowledge:
155
+ self.update_knowledge_for_category(cat)
156
  optimal = max(self.knowledge, key=self.knowledge.get)
157
  self.consciousness += self.knowledge[optimal] * 0.01 * self.dimension_weight
158
  self.spatial_coordinates = self.assign_cognitive_space()