initialize methods
This commit is contained in:
Binary file not shown.
BIN
tensorneat/algorithm/neat/gene/__pycache__/base.cpython-311.pyc
Normal file
BIN
tensorneat/algorithm/neat/gene/__pycache__/base.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -26,6 +26,17 @@ class DefaultConnGene(BaseConnGene):
|
||||
|
||||
def new_custom_attrs(self):
|
||||
return jnp.array([self.weight_init_mean])
|
||||
|
||||
def new_random_attrs(self, key):
|
||||
return jnp.array([mutate_float(key,
|
||||
self.weight_init_mean,
|
||||
self.weight_init_mean,
|
||||
1.0,
|
||||
0,
|
||||
0,
|
||||
1.0,
|
||||
)
|
||||
])
|
||||
|
||||
def mutate(self, key, conn):
|
||||
input_index = conn[0]
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -60,6 +60,16 @@ class DefaultNodeGene(BaseNodeGene):
|
||||
return jnp.array(
|
||||
[self.bias_init_mean, self.response_init_mean, self.activation_default, self.aggregation_default]
|
||||
)
|
||||
|
||||
def new_random_attrs(self, key):
|
||||
return jnp.array([
|
||||
mutate_float(key, self.bias_init_mean, self.bias_init_mean, self.bias_init_std,
|
||||
self.bias_mutate_power, self.bias_mutate_rate, self.bias_replace_rate),
|
||||
mutate_float(key, self.response_init_mean, self.response_init_mean, self.response_init_std,
|
||||
self.response_mutate_power, self.response_mutate_rate, self.response_replace_rate),
|
||||
self.activation_default,
|
||||
self.aggregation_default,
|
||||
])
|
||||
|
||||
def mutate(self, key, node):
|
||||
k1, k2, k3, k4 = jax.random.split(key, num=4)
|
||||
|
||||
Reference in New Issue
Block a user