Evaluator
Bases: XoptBaseModel
Xopt Evaluator for handling the parallel execution of an evaluate function.
Parameters
function : Callable Function to evaluate. function_kwargs : dict, default={} Any kwargs to pass on to this function. max_workers : int, default=1 Maximum number of workers. executor : NormalExecutor NormalExecutor or any instantiated Executor object vectorized : bool, default=False If true, lists of evaluation points will be sent to the evaluator function to be processed in parallel instead of evaluated seperately via mapping.
Source code in xopt/evaluator.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
evaluate(input, **kwargs)
Evaluate a single input dict using Evaluator.function with Evaluator.function_kwargs.
Further kwargs are passed to the function.
Inputs
inputs: dict of inputs to be evaluated **kwargs: additional kwargs to pass to the function
Returns:
Type | Description |
---|---|
function(input, **function_kwargs_updated) |
Source code in xopt/evaluator.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
evaluate_data(input_data)
evaluate dataframe of inputs
Source code in xopt/evaluator.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
safe_function(*args, **kwargs)
Safely call the function, handling exceptions.
Note that this should not be submitted to fuu
Source code in xopt/evaluator.py
130 131 132 133 134 135 136 |
|
submit(input)
submit a single input to the executor
Parameters
input : dict
Returns
Future : Future object
Source code in xopt/evaluator.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
submit_data(input_data)
submit dataframe of inputs to executor
Source code in xopt/evaluator.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|