update to test in servers
This commit is contained in:
@@ -3,7 +3,7 @@ from functools import partial
|
||||
from utils import Configer
|
||||
from algorithms.neat import Pipeline
|
||||
from time_utils import using_cprofile
|
||||
from problems import Sin, Xor
|
||||
from problems import Sin, Xor, DIY
|
||||
|
||||
|
||||
# xor_inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype=np.float32)
|
||||
@@ -25,11 +25,16 @@ from problems import Sin, Xor
|
||||
@partial(using_cprofile, root_abs_path='/mnt/e/neat-jax/', replace_pattern="/mnt/e/neat-jax/")
|
||||
def main():
|
||||
config = Configer.load_config()
|
||||
# problem = Xor()
|
||||
problem = Sin()
|
||||
config.neat.population.pop_size = 50
|
||||
problem = Xor()
|
||||
# problem = Sin()
|
||||
# problem = DIY(func=lambda x: (np.sin(x) + np.exp(x) - x ** 2) / (np.cos(x) + np.sqrt(x)) - np.log(x + 1))
|
||||
problem.refactor_config(config)
|
||||
pipeline = Pipeline(config, seed=11454)
|
||||
pipeline.auto_run(problem.evaluate)
|
||||
pipeline = Pipeline(config, seed=0)
|
||||
best_nodes, best_connections = pipeline.auto_run(problem.evaluate)
|
||||
# print(best_nodes, best_connections)
|
||||
# func = pipeline.function_factory.ask_batch_forward(best_nodes, best_connections)
|
||||
# problem.print(func)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user