def process_observation(self, obs):
"""
Take in the current observation, do any necessary processing and return
the processed observation.
A return value of None indicates that there is no observation yet. A
random action will be taken.
"""
self.current_sequence.append(obs)
if len(self.current_sequence) < self.observations:
return None
if len(self.current_sequence) > self.observations:
self.current_sequence.pop(0)
# convert current sequence to input
# stacking essentially adds a single axis, want it to be after
obs_seq = np.stack(self.current_sequence, axis=len(obs.shape))
return obs_seq
input_stream_sequential_processor.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录