MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / _chunk

Method _chunk

4-atari-hard/2-go-explore.py:154–162  ·  view source on GitHub ↗
(self, chunk_idx)

Source from the content-addressed store, hash-verified

152 + (f" or {self.ancestor}" if self.ancestor else ""))
153
154 def _chunk(self, chunk_idx):
155 if chunk_idx == self.n_flushed:
156 return {"prev": self.prev, "act": self.act}
157 if self.dir:
158 if chunk_idx not in self._cache:
159 z = np.load(self._chunk_path(chunk_idx))
160 self._cache[chunk_idx] = {"prev": z["prev"], "act": z["act"]}
161 return self._cache[chunk_idx]
162 return self._ram_chunks[chunk_idx]
163
164 def reconstruct_actions(self, last_id):
165 """Walk the prev_id chain back to the root (-1); return actions in

Callers 1

reconstruct_actionsMethod · 0.95

Calls 1

_chunk_pathMethod · 0.95

Tested by

no test coverage detected