Spaces:
Sleeping
Sleeping
Update evo_architecture.py
Browse files- evo_architecture.py +6 -6
evo_architecture.py
CHANGED
@@ -37,8 +37,8 @@ def mutate_genome(base_config, exploration_rate=0.5):
|
|
37 |
delta = random.randint(-change, change)
|
38 |
config[mutation_type] = max(min_val, min(max_val, config[mutation_type] + delta))
|
39 |
|
40 |
-
# ✅
|
41 |
-
embed_dim = 512
|
42 |
if config["num_heads"] > embed_dim:
|
43 |
config["num_heads"] = max(1, embed_dim // 64)
|
44 |
while embed_dim % config["num_heads"] != 0:
|
@@ -52,10 +52,10 @@ def mutate_genome(base_config, exploration_rate=0.5):
|
|
52 |
def log_genome(config, score=None):
|
53 |
row = [
|
54 |
config.get("genome_id", ""),
|
55 |
-
config
|
56 |
-
config
|
57 |
-
config
|
58 |
-
config
|
59 |
score if score is not None else ""
|
60 |
]
|
61 |
file_exists = os.path.exists(GENOME_LOG)
|
|
|
37 |
delta = random.randint(-change, change)
|
38 |
config[mutation_type] = max(min_val, min(max_val, config[mutation_type] + delta))
|
39 |
|
40 |
+
# ✅ Ensure num_heads divides d_model cleanly
|
41 |
+
embed_dim = 512
|
42 |
if config["num_heads"] > embed_dim:
|
43 |
config["num_heads"] = max(1, embed_dim // 64)
|
44 |
while embed_dim % config["num_heads"] != 0:
|
|
|
52 |
def log_genome(config, score=None):
|
53 |
row = [
|
54 |
config.get("genome_id", ""),
|
55 |
+
config.get("num_layers", ""),
|
56 |
+
config.get("ffn_dim", ""),
|
57 |
+
config.get("num_heads", ""),
|
58 |
+
config.get("memory_enabled", ""),
|
59 |
score if score is not None else ""
|
60 |
]
|
61 |
file_exists = os.path.exists(GENOME_LOG)
|