if append:
assert id(state) != id(self.state_buffer[-1]), "Do not append to buffer other than during action"
self.state_buffer.append(state)
processed_state = np.stack(self.state_buffer)return processed_state
@lab_api
def update(self, action, reward, state, done):
"""Interface method to update memory"""
After Change
def preprocess_state(self, state, append=True):
"""Transforms the raw state into format that is fed into the network"""
// append when state is first seen when acting in policy_util, don"t append elsewhere in memory
self.preprocess_append(state, append)
return np.stack(self.state_buffer)
class SILReplay(Replay):