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
) – Seeoutput_dir
.- Return type:
- 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:
prev_num_gens (
int
) – Seeprev_num_gens
.len_agents_batch (
int
) – Seelen_agents_batch
.output_dir (
str
) – Seeoutput_dir
.
- 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:
See ~.compute_generation_results.agents_batch`.
- 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:
agents_batch (
list
[list
[BaseAgent
]]) – Seeagents_batch
.generation_results (
ndarray
[Shape
[Pop_size, Num_pops, [fitness, num_env_steps, serialized_agent_size]],dtype
[float32
]] |None
) – Seegeneration_results
.total_num_env_steps (
Optional
[int
]) – Seetotal_num_env_steps
.output_dir (
str
) – Seeoutput_dir
.
- Return type: