35 lines
744 B
Python
35 lines
744 B
Python
import asyncio
|
|
from dotenv import load_dotenv
|
|
|
|
from mathema.core.population_monitor import init_population, continue_
|
|
from mathema.utils.logging_config import setup_logging
|
|
|
|
setup_logging()
|
|
|
|
import logging
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
async def run_xor_test(
|
|
pop_id: str = "xor_pop",
|
|
gens: int = 1000,
|
|
):
|
|
monitor = await init_population((
|
|
pop_id,
|
|
[{"morphology": "xor_mimic", "neural_afs": ["tanh"]}],
|
|
"gt",
|
|
"competition",
|
|
))
|
|
|
|
for _ in range(gens):
|
|
await monitor.gen_ended.wait()
|
|
s = monitor.state
|
|
await monitor._best_fitness_in_population(s.population_id)
|
|
|
|
await monitor.stop("normal")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(run_xor_test())
|