fix bug for using state.randkey in mutate of the gene

This commit is contained in:
wls2002
2024-05-31 16:18:02 +08:00
parent 3a7d05f133
commit bc8267bad0
3 changed files with 3 additions and 3 deletions

View File

@@ -74,7 +74,7 @@ class DefaultNodeGene(BaseNodeGene):
return jnp.array([bias, res, act, agg])
def mutate(self, state, randkey, node):
k1, k2, k3, k4 = jax.random.split(state.randkey, num=4)
k1, k2, k3, k4 = jax.random.split(randkey, num=4)
index = node[0]
bias = mutate_float(

View File

@@ -62,7 +62,7 @@ class NodeGeneWithoutResponse(BaseNodeGene):
return jnp.array([bias, act, agg])
def mutate(self, state, randkey, node):
k1, k2, k3, k4 = jax.random.split(state.randkey, num=4)
k1, k2, k3, k4 = jax.random.split(randkey, num=4)
index = node[0]
bias = mutate_float(

View File

@@ -95,7 +95,7 @@ class NormalizedNode(BaseNodeGene):
return jnp.array([bias, act, agg, mean, std, alpha, beta])
def mutate(self, state, randkey, node):
k1, k2, k3, k4, k5, k6 = jax.random.split(state.randkey, num=6)
k1, k2, k3, k4, k5, k6 = jax.random.split(randkey, num=6)
index = node[0]
bias = mutate_float(