SaveTrainedModelHelper

class SaveTrainedModelHelper(trainBatchSize: Int, testBatchSize: Int)

The object wraps the logic on a given model training up to particular accuracy on a test dataset and then persist it in a file.

Constructors

SaveTrainedModelHelper
Link copied to clipboard
fun SaveTrainedModelHelper(trainBatchSize: Int = 500, testBatchSize: Int = 1000)

Functions

trainAndSave
Link copied to clipboard
fun trainAndSave(train: Dataset, test: Dataset, model: Sequential, path: String, accuracyThreshold: Double = 0.7)

Train model on train dataset and evaluate accuracy on test dataset until accuracyThreshold is reached then saves model to the folder path.