odify genome for the official release

This commit is contained in:
root
2024-07-10 11:24:11 +08:00
parent 075460f896
commit ee8ec84202
83 changed files with 588 additions and 611 deletions

View File

@@ -1,9 +1,11 @@
import jax, jax.numpy as jnp
from utils import (
from tensorneat.common import (
State,
rank_elements,
argmin_with_mask,
fetch_first,
)
from ..genome.utils import (
extract_conn_attrs,
extract_node_attrs,
)
@@ -635,7 +637,9 @@ class DefaultSpecies(BaseSpecies):
# find next node key
all_nodes_keys = state.pop_nodes[:, :, 0]
max_node_key = jnp.max(all_nodes_keys, where=~jnp.isnan(all_nodes_keys), initial=0)
max_node_key = jnp.max(
all_nodes_keys, where=~jnp.isnan(all_nodes_keys), initial=0
)
next_node_key = max_node_key + 1
new_node_keys = jnp.arange(self.pop_size) + next_node_key
@@ -669,4 +673,4 @@ class DefaultSpecies(BaseSpecies):
randkey=randkey,
pop_nodes=pop_nodes,
pop_conns=pop_conns,
)
)