culebra.tools.abc.scripts.TrainerGenerator class¶
- class TrainerGenerator(args: list[str] | None = None)¶
Bases:
GeneratorScriptConstruct the generator.
Define the command-line arguments.
Class attributes¶
- TrainerGenerator.default_max_num_iters = 100¶
The default number of solutions evaluated each iteration will be fixed according to each particular problem. E.g., the number of features/nodes.
- TrainerGenerator.default_num_solutions = None¶
The default number of solutions evaluated each iteration will be fixed according to each particular problem.
- TrainerGenerator.default_trainer_obj = 'trainer.dill.gz'¶
Default output file for the serialized trainer.
- TrainerGenerator.default_training_func_obj = 'training_func.dill.gz'¶
Default intput file for the serialized training fitness function.
Static methods¶
- static TrainerGenerator.load(filename: str) Base¶
Load a serialized object from a file.
- Parameters:
filename (str) – The file name.
- Returns:
The loaded object
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
Methods¶
- TrainerGenerator.dump(filename: str) None¶
Serialize this object and save it to a file.
- Parameters:
filename (str) – The file name.
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
- TrainerGenerator.parse_args() None¶
Parse and validate command-line arguments.
- Raises:
SystemExit – If the command-line arguments are invalid or
--helpis requested.

