change a lot a lot a lot!!!!!!!

This commit is contained in:
wls2002
2023-07-24 02:16:02 +08:00
parent 48f90c7eef
commit ac295c1921
49 changed files with 1138 additions and 1460 deletions

28
core/algorithm.py Normal file
View File

@@ -0,0 +1,28 @@
from jax import Array
from .state import State
from .genome import Genome
EMPTY = lambda *args: args
class Algorithm:
def setup(self, randkey, state: State = State()):
"""initialize the state of the algorithm"""
pass
def ask(self, state: State):
"""require the population to be evaluated"""
pass
def tell(self, state: State, fitness):
"""update the state of the algorithm"""
pass
def forward(self, inputs: Array, transformed: Array):
"""the forward function of a single forward transformation"""
pass
def forward_transform(self, state: State, genome: Genome):
"""create the forward transformation of a genome"""
pass