예제 #1
0
파일: atari.py 프로젝트: lqiang2003cn/dps
    def features(self):
        if self._features is not None:
            return self._features

        _features = []

        if self.store_o:
            obs_shape = (self.obs_shape[0], self.obs_shape[1],
                         self.obs_shape[2] * self.history_length)
            _features.append(ImageFeature("o", obs_shape))

        if self.store_a:
            action_dim = self.action_dim * self.history_length
            _features.append(ArrayFeature("a", (action_dim, )))

        if self.store_r:
            reward_dim = self.reward_dim * self.history_length
            _features.append(ArrayFeature("r", (reward_dim, )))

        if self.store_next_o:
            _features.append(ImageFeature("next_o", self.obs_shape))

        self._features = _features

        return _features
예제 #2
0
    def features(self):
        if self._features is None:
            self._features = [
                ImageFeature("image", self.obs_shape),
                NestedListFeature("annotations", 5),
                IntegerFeature("label", 1),
            ]

            if self.clevr_background_mode is not None:
                self._features.append(
                    ImageFeature("background", self.obs_shape))

        return self._features
예제 #3
0
파일: game.py 프로젝트: lqiang2003cn/dps
    def features(self):
        if self._features is None:
            self._features = [
                ImageFeature("image", self.obs_shape),
                NestedListFeature("annotations", 5),
                IntegerFeature("label", None)
            ]

        return self._features
예제 #4
0
파일: atari.py 프로젝트: lqiang2003cn/dps
    def features(self):
        if self._features is None:
            self._features = [
                ImageFeature("image", self.obs_shape),
                ArrayFeature("action", (self.n_frames, ), np.int32),
                ArrayFeature("reward", (self.n_frames, ), np.float32),
                ArrayFeature("offset", (2, ), dtype=np.int32),
            ]

        return self._features
예제 #5
0
파일: fits.py 프로젝트: pgsrv/auto_yolo
    def features(self):
        if self._features is None:
            annotation_shape = (self.n_frames, -1,
                                7) if self.n_frames > 0 else (-1, 7)
            self._features = [
                ImageFeature("image", self.obs_shape, dtype=np.uint16),
                VariableShapeArrayFeature("annotations", annotation_shape),
                ArrayFeature("offset", (2, ), dtype=np.int32),
                StringFeature("filename"),
            ]

        return self._features
예제 #6
0
파일: atari.py 프로젝트: lqiang2003cn/dps
    def features(self):
        if self._features is None:
            annotation_shape = (self.n_frames, -1,
                                7) if self.n_frames > 0 else (-1, 7)
            self._features = [
                ImageFeature("image", self.obs_shape),
                ArrayFeature("action", (self.n_frames, ), np.int32),
                ArrayFeature("reward", (self.n_frames, ), np.float32),
                ArrayFeature("offset", (2, ), dtype=np.int32),
                VariableShapeArrayFeature("annotations", annotation_shape),
            ]

        return self._features
예제 #7
0
파일: atari.py 프로젝트: lqiang2003cn/dps
    def features(self):
        if self._features is not None:
            return self._features

        _features = []

        _features.append(ImageFeature("o", self.obs_shape))
        _features.append(ArrayFeature("a", (self.action_dim, )))
        _features.append(ArrayFeature("r", (1, )))

        self._features = _features

        return _features
예제 #8
0
파일: gqn.py 프로젝트: lqiang2003cn/dps
    def features(self):
        if self._features is None:
            self._features = [
                ImageFeature("image", self.obs_shape),
                ArrayFeature("pose_r", (
                    self.n_frames,
                    3,
                )),
                ArrayFeature("pose_t", (
                    self.n_frames,
                    3,
                )),
                IntegerFeature("idx"),
            ]

        return self._features