ramjet.trial¶
Boilerplate code for running trials.
Module Contents¶
Functions¶
infer(model: tf.keras.Model, dataset: tf.data.Dataset, infer_results_path: Path, number_of_top_predictions_to_keep: int = None) |
Performs inference of a model on a dataset saving the results to a file. |
save_results(confidences_data_frame: pd.DataFrame, infer_results_path: Path, number_of_top_predictions_to_keep: int = None) → pd.DataFrame |
Saves a predictions data frame to a file. |
create_logging_metrics() → List[tf.metrics.Metric] |
Creates the standard metrics to be used in logging. |
create_logging_callbacks(logs_directory: Path, trial_name: str) → List[callbacks.Callback] |
Creates the callbacks to perform the logging. |
-
infer(model: tf.keras.Model, dataset: tf.data.Dataset, infer_results_path: Path, number_of_top_predictions_to_keep: int = None)[source]¶ Performs inference of a model on a dataset saving the results to a file.
Parameters: - model – The model to infer with.
- dataset – The dataset to infer on.
- infer_results_path – The path to save the resulting predictions to.
- number_of_top_predictions_to_keep – The number of top results to keep. None will save all results.
-
save_results(confidences_data_frame: pd.DataFrame, infer_results_path: Path, number_of_top_predictions_to_keep: int = None) → pd.DataFrame[source]¶ Saves a predictions data frame to a file.
Parameters: - confidences_data_frame – The data frame of predictions to save.
- infer_results_path – The path to save the resulting predictions to.
- number_of_top_predictions_to_keep – The number of top results to keep. None will save all results.
Returns: The updated data frame.