当前位置: 首页>>代码示例>>Python>>正文


Python EpisodicTask.performAction方法代码示例

本文整理汇总了Python中pybrain.rl.environments.EpisodicTask.performAction方法的典型用法代码示例。如果您正苦于以下问题:Python EpisodicTask.performAction方法的具体用法?Python EpisodicTask.performAction怎么用?Python EpisodicTask.performAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pybrain.rl.environments.EpisodicTask的用法示例。


在下文中一共展示了EpisodicTask.performAction方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     """ POMDP tasks, as they have discrete actions, can me used by providing either an index,
     or an array with a 1-in-n coding (which can be stochastic). """
     if type(action) == ndarray:
         action = drawIndex(action, tolerant = True)
     self.steps += 1
     EpisodicTask.performAction(self, action)
开发者ID:ZachPhillipsGary,项目名称:CS200-NLP-ANNsProject,代码行数:9,代码来源:pomdp.py

示例2: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
    def performAction(self, action):
        action = self.action_from_joint_angles(action)

        # Carry out the action based on angular velocities
        EpisodicTask.performAction(self, action)

        return
开发者ID:evansneath,项目名称:surgicalsim,代码行数:9,代码来源:task.py

示例3: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     #Filtered mapping towards performAction of the underlying environment
     #The standard Johnnie task uses a PID controller to controll directly angles instead of forces
     #This makes most tasks much simpler to learn
     isJoints=self.env.getSensorByName('JointSensor') #The joint angles
     isSpeeds=self.env.getSensorByName('JointVelocitySensor') #The joint angular velocitys
     act=(action+1.0)/2.0*(self.env.cHighList-self.env.cLowList)+self.env.cLowList #norm output to action intervall
     action=tanh((act-isJoints-isSpeeds)*16.0)*self.maxPower*self.env.tourqueList #simple PID
     EpisodicTask.performAction(self, action)
开发者ID:DanSGraham,项目名称:code,代码行数:11,代码来源:johnnie.py

示例4: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     """ a filtered mapping towards performAction of the underlying environment. """
     # scaling
     self.incStep()
     action = (action + 1.0) / 2.0 * self.dif + self.env.fraktMin * self.env.dists[0]
     #Clipping the maximal change in actions (max force clipping)
     action = clip(action, self.action - self.maxSpeed, self.action + self.maxSpeed)
     EpisodicTask.performAction(self, action)
     self.action = action.copy()
开发者ID:DanSGraham,项目名称:code,代码行数:11,代码来源:tasks.py

示例5: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     #Filtered mapping towards performAction of the underlying environment
     #The standard CCRL task uses a PID controller to controll directly angles instead of forces
     #This makes most tasks much simpler to learn
     self.oldAction = action
     #Grasping as reflex depending on the distance to target - comment in for more easy grasping
     if abs(abs(self.dist[:3]).sum())<2.0: action[15]=1.0 #self.grepRew=action[15]*.01
     else: action[15]=-1.0 #self.grepRew=action[15]*-.03
     isJoints=array(self.env.getSensorByName('JointSensor')) #The joint angles
     isSpeeds=array(self.env.getSensorByName('JointVelocitySensor')) #The joint angular velocitys
     act=(action+1.0)/2.0*(self.env.cHighList-self.env.cLowList)+self.env.cLowList #norm output to action intervall
     action=tanh((act-isJoints-0.9*isSpeeds*self.env.tourqueList)*16.0)*self.maxPower*self.env.tourqueList #simple PID
     EpisodicTask.performAction(self, action)
开发者ID:Boblogic07,项目名称:pybrain,代码行数:15,代码来源:ccrl.py

示例6: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     #Filtered mapping towards performAction of the underlying environment
     #The standard Tetra2 task uses a PID controller to control directly angles instead of forces
     #This makes most tasks much simpler to learn
     isJoints=self.env.getSensorByName('JointSensor') #The joint angles
     #print "Pos:", [int(i*10) for i in isJoints]
     isSpeeds=self.env.getSensorByName('JointVelocitySensor') #The joint angular velocitys
     #print "Speeds:", [int(i*10) for i in isSpeeds]
     #print "Action", action, "cHighList",self.env.cHighList , self.env.cLowList
     #act=(action+1.0)/2.0*(self.env.cHighList-self.env.cLowList)+self.env.cLowList #norm output to action intervall
     #action=tanh(act-isJoints-isSpeeds)*self.maxPower*self.env.tourqueList #simple PID
     #print "Action", act[:5]
     EpisodicTask.performAction(self, action *self.maxPower*self.env.tourqueList)
开发者ID:gcobos,项目名称:leggedbot,代码行数:15,代码来源:tetra_tasks.py

示例7: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     self.t += 1
     EpisodicTask.performAction(self, action)
开发者ID:nvaller,项目名称:pug-ann,代码行数:5,代码来源:example.py

示例8: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     EpisodicTask.performAction(self, action)
     self.action = action
开发者ID:DanSGraham,项目名称:School-Projects,代码行数:5,代码来源:tasks.py

示例9: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
	def performAction(self, action):
	
		self.oldDist = self.__getDistance()		# copy current distance for shaping reward
		EpisodicTask.performAction(self, action)

		self.count += 1
开发者ID:krylenko,项目名称:python,代码行数:8,代码来源:INFOMAX__mazeTask.py

示例10: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     EpisodicTask.performAction(self, action)
     self.t += self.dt
     self.appendLog()
开发者ID:Juxi,项目名称:pybrain,代码行数:6,代码来源:dockingtask.py

示例11: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, action):
     EpisodicTask.performAction(self, action*self.maxPower)
开发者ID:Angeliqe,项目名称:pybrain,代码行数:4,代码来源:acrobot.py

示例12: performAction

# 需要导入模块: from pybrain.rl.environments import EpisodicTask [as 别名]
# 或者: from pybrain.rl.environments.EpisodicTask import performAction [as 别名]
 def performAction(self, actions):
     self.t += 1
     actions = clip(actions, -0.05, 0.05) # set speed limit
     EpisodicTask.performAction(self, actions)
开发者ID:akansal1,项目名称:einstein,代码行数:6,代码来源:robot_tasks.py


注:本文中的pybrain.rl.environments.EpisodicTask.performAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。