readwrite

File reading and writing utilities for Neuroevolution fitting.

cneuromax.fitting.neuroevolution.utils.readwrite.find_existing_save_points(output_dir)[source]

Returns a list of existing save points.

Parameters:

output_dir (str) – See output_dir.

Return type:

list[int]

Returns:

The list of existing save points.

cneuromax.fitting.neuroevolution.utils.readwrite.load_state(prev_num_gens, len_agents_batch, output_dir)[source]

Load a previous experiment state from disk.

Parameters:
Return type:

tuple[list[list[BaseAgent]], ndarray[Shape[Pop_size, Num_pops, [fitness, num_env_steps, serialized_agent_size]], dtype[float32]] | None, Optional[int]]

Returns:

cneuromax.fitting.neuroevolution.utils.readwrite.save_state(agents_batch, generation_results, total_num_env_steps, curr_gen, output_dir)[source]

Dump the current experiment state to disk.

Parameters:
Return type:

None