MCPcopy
hub / github.com/tensorlayer/TensorLayer / get

Method get

examples/reinforcement_learning/tutorial_TRPO.py:160–172  ·  view source on GitHub ↗

Call this at the end of an epoch to get all of the data from the buffer, with advantages appropriately normalized (shifted to have mean zero and std one). Also, resets some pointers in the buffer.

(self)

Source from the content-addressed store, hash-verified

158 return self.ptr == self.max_size
159
160 def get(self):
161 """
162 Call this at the end of an epoch to get all of the data from
163 the buffer, with advantages appropriately normalized (shifted to have
164 mean zero and std one). Also, resets some pointers in the buffer.
165 """
166 assert self.ptr == self.max_size # buffer has to be full before you can get
167 self.ptr, self.path_start_idx = 0, 0
168
169 # the next two lines implement the advantage normalization trick
170 adv_mean, adv_std = np.mean(self.adv_buf), np.std(self.adv_buf)
171 self.adv_buf = (self.adv_buf - adv_mean) / adv_std
172 return [self.obs_buf, self.act_buf, self.adv_buf, self.ret_buf, self.logp_buf, self.mean_buf, self.log_std_buf]
173
174
175"""

Callers 15

setup.pyFile · 0.80
find_top_modelMethod · 0.80
find_top_datasetMethod · 0.80
find_datasetsMethod · 0.80
create_task_spec_defFunction · 0.80
read_analogies_fileFunction · 0.80
words_to_word_idsFunction · 0.80
sentence_to_token_idsFunction · 0.80
save_response_contentFunction · 0.80
_GetNextLogCountPerTokenFunction · 0.80
_get_gpu_idsFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_violationsMethod · 0.64