knn.py 文件源码

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

项目:episodic_control 作者: miyosuda 项目源码 文件源码
def _add(self, state, r):
    if self._current_capacity >= self._capacity:
      # find the LRU entry
      old_index = np.argmin(self._lru) # ??????????
      self._states[old_index] = state
      self._q_values[old_index] = r
      self._lru[old_index] = self._time
    else:
      self._states[self._current_capacity] = state
      self._q_values[self._current_capacity] = r
      self._lru[self._current_capacity] = self._time
      self._current_capacity += 1

    self._time += 0.01
    # ????????
    self._tree = KDTree(self._states[:self._current_capacity])

    # TDOO: _time?????????????????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号