
DQN bootstrap MSE loss (Geron Ch 19, morie.fn grdqnl)
Source:R/geron_train_native.R
morie_geron_dqn_loss.RdDQN bootstrap MSE loss (Geron Ch 19, morie.fn grdqnl)
Examples
Q <- matrix(0.5, 4, 2)
Qt <- matrix(0.5, 4, 2)
batch <- list(c(0L, 0L, 1, 1L, 0L), c(1L, 1L, 0, 2L, 1L))
morie_geron_dqn_loss(Q, Qt, batch, gamma = 0.9)
#> $loss
#> [1] 0.57625
#>
#> $targets
#> [1] 1.45 0.00
#>
#> $predictions
#> [1] 0.5 0.5
#>
#> $td_errors
#> [1] 0.95 -0.50
#>
#> $max_abs_td_error
#> [1] 0.95
#>
#> $n_terminal
#> [1] 1
#>
#> $gamma
#> [1] 0.9
#>
#> $estimate
#> [1] 0.57625
#>
#> $n
#> [1] 2
#>