简体   繁体   English

深度强化学习(keras-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. 根据这些家伙( https://nihit.github.io/resources/spaceinvaders.pdf )的介绍,可以通过深度强化学习进行早期停止。 I used that before with Deep Learning on Keras, but, how to do that on keras-rl? 之前,我曾在Keras上进行过深度学习,但是在keras-rl上该怎么做? in the same fit() function or before sending the model to the agent? 在相同的fit()函数中还是在将模型发送给代理之前?

It looks like you could just use keras's callback; 看起来您可以只使用keras的回调; 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM