Base generator class
xopt.generator ¶
Classes¶
xopt.generator.Generator ¶
Generator(**kwargs)
Bases: XoptBaseModel
, ABC
Base class for Generators.
Generators are responsible for generating new points to evaluate.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the generator. |
supports_batch_generation |
bool
|
Flag that describes if this generator can generate batches of points. |
supports_multi_objective |
bool
|
Flag that describes if this generator can solve multi-objective problems. |
vocs |
VOCS
|
Generator VOCS. |
data |
(DataFrame, optional)
|
Generator data. |
model_config |
ConfigDict
|
Model configuration. |
Initialize the generator.
Source code in xopt/generator.py
102 103 104 105 106 107 108 |
|
Functions¶
add_data(new_data)
update dataframe with results from new evaluations.
This is intended for generators that maintain their own data.
Source code in xopt/generator.py
114 115 116 117 118 119 120 121 122 123 124 |
|
model_dump(*args, **kwargs)
overwrite model dump to remove faux class attrs
Source code in xopt/generator.py
126 127 128 129 130 131 132 133 134 |
|
xopt.generator.StateOwner ¶
Mix-in class that represents a generator that owns its own state and needs special handling of data loading on deserialization.
Functions¶
set_data(data)
Set the full dataset for the generator. Typically only used when loading from a save file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
DataFrame
|
The data to set. |
required |
Source code in xopt/generator.py
143 144 145 146 147 148 149 150 151 152 |
|