disable activation in the output node of network;

we recommend to use output_transform;
change hyperparameters (strong) in XOR example;
This commit is contained in:
wls2002
2024-05-22 11:09:25 +08:00
parent bb80f12640
commit 1fe5d5fca2
7 changed files with 59 additions and 14 deletions

View File

@@ -92,7 +92,10 @@ class DefaultNodeGene(BaseNodeGene):
z = bias + res * z
# the last output node should not be activated
if not is_output_node:
z = act(act_idx, z, self.activation_options)
z = jax.lax.cond(
is_output_node,
lambda: z,
lambda: act(act_idx, z, self.activation_options)
)
return z