machine-learningkerasdeep-learningreinforcement-learningkeras-rl

Deep Reinforcement Learning (keras-rl) Early stopping


According to these guys (https://nihit.github.io/resources/spaceinvaders.pdf) it is possible to perform Early Stopping with Deep Reinforcement Learning. I used that before with Deep Learning on Keras, but, how to do that on keras-rl? in the same fit() function or before sending the model to the agent?


Solution

  • It looks like you could just use keras's callback; if you really want it in the package, grab it from here and put it in here. Otherwise, I would try:

    from keras.callbacks import EarlyStopping
    
    early_stop = EarlyStopping(patience=69) # epochs stagnation before termination
    
    # from their example cem_cartpole.py
    cem.fit(env, nb_steps=100000, visualize=False, callbacks=[early_stop], verbose=2)