February 2020
Intermediate to advanced
328 pages
8h 19m
English
Estimators provide a utility called run hooks so that we can track training, report progress, request early stopping, and more. One such utility is the hook_history_saver() function, which lets us save training history in every training step. While training an estimator, we pass our run hooks' definition to the hooks argument of the train() function, as shown in the following code block. It saves model progress after every two training iterations and returns saved training metrics.
The following code block shows how to implement run hooks:
training_history <- train(regressor, input_fn = estimator_input_fn(data_ = dummy_data_estimator), hooks = list(hook_history_saver(every_n_step = 2)) )
Other pre-built run hooks are provided ...
Read now
Unlock full access