
Batch-size heuristic (Geron Ch 9, morie.fn hmbsz)
Source:R/geron_ml_native.R
morie_geron_batch_size_heuristic.RdLargest power of two in {32, 64, 128, 256, 512} not exceeding
n_train / steps_per_epoch_target (and memory_limit if supplied),
flooring at min(32, n_train) when nothing is feasible.
Examples
morie_geron_batch_size_heuristic(n_train = 5L)
#> $batch_size
#> [1] 5
#>
#> $steps_per_epoch
#> [1] 1
#>
#> $candidates
#> [1] 32 64 128 256 512
#>
#> $cap
#> [1] 0.5
#>
#> $clamped
#> [1] TRUE
#>
#> $estimate
#> [1] 5
#>
#> $n
#> [1] 5
#>
#> $method
#> [1] "Batch size heuristic (largest power of two in [32, 512] under the step-count cap)"
#>