MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __init__

Method __init__

examples/DeepQNetwork/expreplay.py:118–140  ·  view source on GitHub ↗

Args: player (gym.Env) predictor (callable): the model forward function which takes a state and returns the prediction. memory (ReplayMemory): the replay memory to store experience to. history_len (int):

(self, player, predictor, memory, history_len)

Source from the content-addressed store, hash-verified

116 and fill the results to experience replay buffer.
117 """
118 def __init__(self, player, predictor, memory, history_len):
119 """
120 Args:
121 player (gym.Env)
122 predictor (callable): the model forward function which takes a
123 state and returns the prediction.
124 memory (ReplayMemory): the replay memory to store experience to.
125 history_len (int):
126 """
127 self.player = player
128 self.num_actions = player.action_space.n
129 self.predictor = predictor
130 self.memory = memory
131 self.state_shape = memory.state_shape
132 self.dtype = memory.dtype
133 self.history_len = history_len
134
135 self._current_episode = []
136 self._current_ob = player.reset()
137 self._current_game_score = StatCounter() # store per-step reward
138 self.total_scores = [] # store per-game total score
139
140 self.rng = get_rng(self)
141
142 def step(self, exploration):
143 """

Callers

nothing calls this directly

Calls 3

StatCounterClass · 0.90
get_rngFunction · 0.90
resetMethod · 0.45

Tested by

no test coverage detected