input_stream_sequential_processor.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:rlflow 作者: tpbarron 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号