HemanM commited on
Commit
4ecef43
·
verified ·
1 Parent(s): 572ec43

Update evo_architecture.py

Browse files
Files changed (1) hide show
  1. 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
- # ✅ Fix: Ensure embed_dim is divisible by num_heads
41
- embed_dim = 512 # Your hardcoded d_model
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["num_layers"],
56
- config["ffn_dim"],
57
- config["num_heads"],
58
- config["memory_enabled"],
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)