Training

Description

The Training module provides a class for training Keras models using datasets from research_attributes.

Main Class

class Trainer

A class to train a Keras model using datasets from research_attributes.

__init__()

Initializes the Trainer.

set_compiled_model(model: tf.keras.Model)

Sets the compiled Keras model for training.

Parameters:

model (tf.keras.Model) – The compiled Keras model.

fit_predict_evaluate(**kwargs)

Trains the model, saves training history, makes predictions, and evaluates outputs.

Requires a ‘train_dataset’ for training. Optionally, a ‘val_dataset’ can be provided for validation, and a ‘test_dataset’ for evaluation.

Parameters:

kwargs (dict) – Keyword arguments for the Keras model’s fit method.

Evaluation Methods:

Supported evaluation methods include: