Custom callback to remove the faulty episode and start new episode

I have a custom environment that communicates with the separate game engine on a server and processes the information about the game as a state of the environment. However, sometimes, the server or game engine may get stuck, resulting in a faulty episode, as it cannot get current information about the game and turn it into the state matrix. Is it possible to write a callback function that will start a new episode in this case and remove the sample from the faulty episode?

1 Like