change a lot
This commit is contained in:
38
algorithm/neat/gene/base.py
Normal file
38
algorithm/neat/gene/base.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from jax import Array, numpy as jnp
|
||||
|
||||
|
||||
class BaseGene:
|
||||
node_attrs = []
|
||||
conn_attrs = []
|
||||
|
||||
@staticmethod
|
||||
def setup(state, config):
|
||||
return state
|
||||
|
||||
@staticmethod
|
||||
def new_node_attrs(state):
|
||||
return jnp.zeros(0)
|
||||
|
||||
@staticmethod
|
||||
def new_conn_attrs(state):
|
||||
return jnp.zeros(0)
|
||||
|
||||
@staticmethod
|
||||
def mutate_node(state, attrs: Array, key):
|
||||
return attrs
|
||||
|
||||
@staticmethod
|
||||
def mutate_conn(state, attrs: Array, key):
|
||||
return attrs
|
||||
|
||||
@staticmethod
|
||||
def distance_node(state, array: Array):
|
||||
return array
|
||||
|
||||
@staticmethod
|
||||
def distance_conn(state, array: Array):
|
||||
return array
|
||||
|
||||
@staticmethod
|
||||
def forward(state, array: Array):
|
||||
return array
|
||||
Reference in New Issue
Block a user