當前位置: 首頁>>代碼示例>>Python>>正文


Python EpisodicTask.__init__方法代碼示例

本文整理匯總了Python中pybrain.rl.environments.episodic.EpisodicTask.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python EpisodicTask.__init__方法的具體用法?Python EpisodicTask.__init__怎麽用?Python EpisodicTask.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pybrain.rl.environments.episodic.EpisodicTask的用法示例。


在下文中一共展示了EpisodicTask.__init__方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pybrain.rl.environments.episodic import EpisodicTask [as 別名]
# 或者: from pybrain.rl.environments.episodic.EpisodicTask import __init__ [as 別名]
 def __init__(self, env, episodeLength):
     EpisodicTask.__init__(self, env)
     #self.inDim = 1 
     #self.outDim = 1
     self.counter = 0
     self.history = []
     self.total = []
     self.episodeLength = episodeLength
開發者ID:schmalerc,項目名稱:pybrain,代碼行數:10,代碼來源:ipdexample.py

示例2: __init__

# 需要導入模塊: from pybrain.rl.environments.episodic import EpisodicTask [as 別名]
# 或者: from pybrain.rl.environments.episodic.EpisodicTask import __init__ [as 別名]
 def __init__(self, environment):
     '''
     Constructor
     '''
     EpisodicTask.__init__(self, environment)
     self.prev_time = 0
     self.current_time = 0 
     self.reward = 0
開發者ID:jaegs,項目名稱:AI_Practicum,代碼行數:10,代碼來源:task.py

示例3: __init__

# 需要導入模塊: from pybrain.rl.environments.episodic import EpisodicTask [as 別名]
# 或者: from pybrain.rl.environments.episodic.EpisodicTask import __init__ [as 別名]
 def __init__(self, size, opponent = None, **args):
     EpisodicTask.__init__(self, PenteGame((size, size)))
     self.setArgs(**args)
     if opponent == None:
         opponent = RandomGomokuPlayer(self.env)
     elif isclass(opponent):
         # assume the agent can be initialized without arguments then.
         opponent = opponent(self.env)
     if not self.opponentStart:
         opponent.color = PenteGame.WHITE
     self.opponent = opponent
     self.minmoves = 9
     self.maxmoves = self.env.size[0] * self.env.size[1]
     self.reset()
開發者ID:DanSGraham,項目名稱:code,代碼行數:16,代碼來源:pentetask.py

示例4: __init__

# 需要導入模塊: from pybrain.rl.environments.episodic import EpisodicTask [as 別名]
# 或者: from pybrain.rl.environments.episodic.EpisodicTask import __init__ [as 別名]
 def __init__(self, size, opponent = None, **args):
     EpisodicTask.__init__(self, CaptureGame(size))
     self.setArgs(**args)
     if opponent == None:
         opponent = RandomCapturePlayer(self.env)
     elif isclass(opponent):
         # assume the agent can be initialized without arguments then.
         opponent = opponent(self.env)
     else:
         opponent.game = self.env
     if not self.opponentStart:
         opponent.color = CaptureGame.WHITE
     self.opponent = opponent
     self.maxmoves = self.env.size * self.env.size
     self.minmoves = 3
     self.reset()
開發者ID:DanSGraham,項目名稱:code,代碼行數:18,代碼來源:capturetask.py

示例5: __init__

# 需要導入模塊: from pybrain.rl.environments.episodic import EpisodicTask [as 別名]
# 或者: from pybrain.rl.environments.episodic.EpisodicTask import __init__ [as 別名]
    def __init__(self,
                 environment,
                 deltaP,
                 deltaF,
                 deltaS,
                 discount,
                 backtest=False):
        """ Standard constructor for the asset allocation task.

        Args:
            environment (Environment): market environment object
            deltaP (double): proportional transaction costs rate
            deltaF (double): fixed transaction cost rate
            deltaS (double): short selling borrowing cost rate
            discount (double): discount factor
            backtest (bool): flag for training mode or test mode
        """
        # Initialize episodic task
        EpisodicTask.__init__(self, environment)

        # Transaction costs
        self.deltaP = deltaP
        self.deltaF = deltaF
        self.deltaS = deltaS

        # Discount factor
        self.discount = discount

        # Backtesting
        self.backtest = backtest

        # Report stores allocations and portfolio log-returns for backtesting
        self.report = pd.DataFrame(columns=list(self.env.data.columns) +
                                           ['ptfLogReturn'])

        # Initialize allocation
        self.initializeAllocation()
開發者ID:pnecchi,項目名稱:Thesis,代碼行數:39,代碼來源:assetallocationtask.py


注:本文中的pybrain.rl.environments.episodic.EpisodicTask.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。