last workig state.
This commit is contained in:
34
mathema/xor_main.py
Normal file
34
mathema/xor_main.py
Normal file
@@ -0,0 +1,34 @@
|
||||
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())
|
||||
Reference in New Issue
Block a user