update gene

This commit is contained in:
root
2024-07-10 16:33:18 +08:00
parent 649d4b0552
commit 3170d2a3d5
8 changed files with 3 additions and 491 deletions

View File

@@ -16,13 +16,6 @@ class BaseConnGene(BaseGene):
def forward(self, state, attrs, inputs):
raise NotImplementedError
def update_by_batch(self, state, attrs, batch_inputs):
# default: do not update attrs, but to calculate batch_res
return (
jax.vmap(self.forward, in_axes=(None, None, 0))(state, attrs, batch_inputs),
attrs,
)
def repr(self, state, conn, precision=2, idx_width=3, func_width=8):
in_idx, out_idx = conn[:2]
in_idx = int(in_idx)