ianyangchina / uof-paper-code Goto Github PK
View Code? Open in Web Editor NEWOfficial implementation for the UOF paper (algorithm & environment)
License: MIT License
Official implementation for the UOF paper (algorithm & environment)
License: MIT License
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 搞混了呢?
一个是左闭右开区间,另一个是左闭右闭区间
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.