Current Progress: After final design presentation

This commit is contained in:
wls2002
2023-06-19 15:17:56 +08:00
parent acedd67617
commit 5cbe3c14bb
34 changed files with 533 additions and 558 deletions

27
neat/pipeline_.py Normal file
View File

@@ -0,0 +1,27 @@
import jax
from configs.configer import Configer
from .genome.genome_ import initialize_genomes
class Pipeline:
"""
Neat algorithm pipeline.
"""
def __init__(self, config, seed=42):
self.randkey = jax.random.PRNGKey(seed)
self.config = config # global config
self.jit_config = Configer.create_jit_config(config) # config used in jit-able functions
self.N = self.config["init_maximum_nodes"]
self.C = self.config["init_maximum_connections"]
self.S = self.config["init_maximum_species"]
self.generation = 0
self.best_genome = None
self.pop_nodes, self.pop_cons, self.input_idx, self.output_idx = initialize_genomes(self.N, self.C, self.config)
print(self.pop_nodes, self.pop_cons, self.input_idx, self.output_idx, sep='\n')
print(self.jit_config)