Current Progress: After final design presentation
This commit is contained in:
27
neat/pipeline_.py
Normal file
27
neat/pipeline_.py
Normal 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)
|
||||
Reference in New Issue
Block a user