evaluation
BaseEvaluationModel(config)
¶
Bases: ABC
Base interface for all evaluation models.
Source code in quadra/models/evaluation.py
29 30 31 32 33 |
|
training: bool
property
¶
Return whether model is in training mode.
cpu()
abstractmethod
¶
Move model to cpu.
Source code in quadra/models/evaluation.py
55 56 57 |
|
eval()
abstractmethod
¶
Set model to evaluation mode.
Source code in quadra/models/evaluation.py
47 48 49 |
|
half()
abstractmethod
¶
Convert model to half precision.
Source code in quadra/models/evaluation.py
51 52 53 |
|
load_from_disk(model_path, device='cpu')
abstractmethod
¶
Load model from disk.
Source code in quadra/models/evaluation.py
39 40 41 |
|
to(device)
abstractmethod
¶
Move model to device.
Source code in quadra/models/evaluation.py
43 44 45 |
|
ONNXEvaluationModel(config)
¶
Bases: BaseEvaluationModel
Wrapper for ONNX models. It's designed to provide a similar interface to standard torch models.
Source code in quadra/models/evaluation.py
134 135 136 137 138 139 140 |
|
__call__(*inputs)
¶
Run inference on the model and return the output as torch tensors.
Source code in quadra/models/evaluation.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
cpu()
¶
Move model to cpu.
Source code in quadra/models/evaluation.py
266 267 268 |
|
eval()
¶
Fake interface to match torch models.
Source code in quadra/models/evaluation.py
259 260 |
|
generate_session_options()
¶
Generate session options from the current config.
Source code in quadra/models/evaluation.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
half()
¶
Convert model to half precision.
Source code in quadra/models/evaluation.py
262 263 264 |
|
load_from_disk(model_path, device='cpu')
¶
Load model from disk.
Source code in quadra/models/evaluation.py
227 228 229 230 231 232 233 |
|
to(device)
¶
Move model to device.
Source code in quadra/models/evaluation.py
253 254 255 256 257 |
|
TorchEvaluationModel(config, model_architecture)
¶
Bases: TorchscriptEvaluationModel
Wrapper for torch models.
Parameters:
-
model_architecture
(
Module
) –Optional torch model architecture
Source code in quadra/models/evaluation.py
112 113 114 115 116 117 |
|
load_from_disk(model_path, device='cpu')
¶
Load model from disk.
Source code in quadra/models/evaluation.py
122 123 124 125 126 127 128 |
|
TorchscriptEvaluationModel
¶
Bases: BaseEvaluationModel
Wrapper for torchscript models.
training: bool
property
¶
Return whether model is in training mode.
cpu()
¶
Move model to cpu.
Source code in quadra/models/evaluation.py
100 101 102 |
|
eval()
¶
Set model to evaluation mode.
Source code in quadra/models/evaluation.py
87 88 89 |
|
half()
¶
Convert model to half precision.
Source code in quadra/models/evaluation.py
96 97 98 |
|
load_from_disk(model_path, device='cpu')
¶
Load model from disk.
Source code in quadra/models/evaluation.py
71 72 73 74 75 76 77 78 79 80 |
|
to(device)
¶
Move model to device.
Source code in quadra/models/evaluation.py
82 83 84 85 |
|