You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def sample(self, maxlen=0):
L = len(self.memory)
if L > 0:
e = random.randrange(L)
mem = self.memory[e]
T = len(mem)
# Take a random subset of trajectory if maxlen specified, otherwise return full trajectory
if maxlen > 0 and T > maxlen + 1:
t = random.randrange(T - maxlen - 1) # Include next state after final "maxlen" state
return mem[t:t + maxlen + 1]
else:
return mem
else :
return None
Can we write the code in this way? I do not get the reason behind using while (True)
The text was updated successfully, but these errors were encountered:
ACER/memory.py
Line 24 in 3676af0
Can we write the code in this way? I do not get the reason behind using while (True)
The text was updated successfully, but these errors were encountered: