update functions. Visualize, Interpretable and with evox

This commit is contained in:
root
2024-07-12 04:35:22 +08:00
parent 5fc63fdaf1
commit 0d6e7477bf
32 changed files with 207 additions and 427 deletions

View File

@@ -6,7 +6,7 @@ from tensorneat.genome import DefaultGenome, DefaultNode, DefaultMutation, BiasN
from tensorneat.problem.func_fit import CustomFuncFit
from tensorneat.common import ACT, AGG
# define a custom function fit problem
def pagie_polynomial(inputs):
x, y = inputs
res = 1 / (1 + jnp.pow(x, -4)) + 1 / (1 + jnp.pow(y, -4))
@@ -14,9 +14,12 @@ def pagie_polynomial(inputs):
# important! returns an array, NOT a scalar
return jnp.array([res])
# define custom activate function and register it
def square(x):
return x ** 2
ACT.add_func("square", square)
if __name__ == "__main__":
custom_problem = CustomFuncFit(
func=pagie_polynomial,
low_bounds=[-1, -1],