Giter Club home page Giter Club logo

uof-paper-code's People

Contributors

ianyangchina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

uof-paper-code's Issues

作者代码中的 replay_buffer 里面的 randint没有问题

replay_buffer.py
def sample_achieved_goal_random(self, ep):
goals = [[], []]
for k_ in range(self.k):
done = False
count = 0
while not done:
count += 1
if count > len(ep):
break
ind = R.randint(0, len(ep)-1) # pytho自带的 random.randint(low,high) 是闭区间!这里没问题
goal = ep[ind].achieved_goal
这里作者也用到的是 randint(low,high-1)的格式,想要取到 0-24 的值,因为python自带的 random.randint(low, high) 是闭区间的,所以这里没有问题,
是不是上个issue里面的问题是作者把 np.random.randint 和 python自带的 random.randint 搞混了呢?
一个是左闭右开区间,另一个是左闭右闭区间

关于_sample_goal 中 random_integers,还有 _select_option 中的 randint 问题

multigoal_fetch_env.py 中
def _sample_goal(self):
'''
这个貌似有点问题,用ind只可能返回0,1,永远得不到最难的那个subgoal作为desired goal啊
'''
# this function will return a final goal
ind = self.np_random.random_integers(0, len(self.final_goal_space)) # random_integers 在gym中 = randint,左闭右开区间
goal_str = self.final_goal_strs[ind]
return goal_str

universal_option_framework.py 中
def _select_option(self, state, high_level_goal, desired_goal_id, ep=0, test=False):
。。。
else:
if self.env.np_random.uniform(0, 1) < self.optor_exploration(ep):

            # 这个貌似有点问题,用ind只可能返回0,1,永远得不到最难的那个subgoal作为desired goal啊
            option = self.env.np_random.randint(0, self.option_num-1)  
        else:
            option = T.argmax(option_values).item()
    return option

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.