module documentation
Validation script to measure and report the classifier's performance.
Subfolders are required to follow the convention: "val/PD" and "val/Control".
| Function | plot |
Plot an ROC curve for the given matched and non-matched scores |
| Function | validate |
Stand the model up and produce validation metrics. |
| Function | _create |
Create a torch 'DataLoader' for the validation data. |
| Function | _t2n |
Tensor to Numpy When using Torch, converting to Numpy often errors with the need to pass back to CPU first and sometimes additionally detaching explicitly. tolist() does this automatically, and works when exclusively on CPU... |
def plot_roc(plt, matched, non_matched, label='ROC', axes=None, steps=1000, verbose=False, max_value=None, return_stats=False):
Plot an ROC curve for the given matched and non-matched scores
| Parameters | |
| plt | matplotlib reference object |
matched:np.ndarray | A numpy array of matched scores |
nonnp.ndarray | A numpy array of non-matched scores |
| label | The label for the plotted line |
| axes | The axes to use for the plot; if None, new axes will be made |
| steps | The number of steps to use for the plot (# bins) |
| verbose | When true, output information about threshold values |
| max | Use this to override the max score to consider |
| return | Return a dictionary with performance metrics |
| Returns | |
| The axes used for the plot | |
def validate(model_file, training_dump_path, batch_size=32):
Stand the model up and produce validation metrics.
| Parameters | |
modelstr | path to weights (checkpoint) to be loaded (str) |
trainingstr | Base folder location of the training data |
batchint | Size of minibatch |
| Returns | |
dict | output data and labels (dict) |