reinforcelearn
reinforcelearn copied to clipboard
keras training is too slow
consider this:
set.seed(123)
library(keras)
load_all()
env = mountainCar()
preprocessState = function(state) {
state[1, , drop = FALSE]
}
m = keras_model_sequential()
m %>% layer_dense(input_shape = 2, activation = "relu", units = 10L)
m %>% layer_dense(input_shape = 10L, activation = "linear", units = env$n.actions)
res = qlearning(env, fun.approx = "neural.network", model = m, preprocessState = preprocessState,
n.episodes = 5)
this takes minutes just to sweep through one episode?
actually it doesnt seem to return at all?
@berndbischl mxnet might be a better choice for training