MCPcopy Create free account
hub / github.com/deepdrive/deepdrive / set_random_action_repeat_count

Method set_random_action_repeat_count

tensorflow_agent/agent.py:233–252  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

231 return obz
232
233 def set_random_action_repeat_count(self):
234 if self.semirandom_sequence_step == (self.random_action_count + self.non_random_action_count):
235 self.semirandom_sequence_step = 0
236 rand = c.RNG.random()
237 if 0 <= rand < 0.67:
238 self.random_action_count = 0
239 self.non_random_action_count = 10
240 elif 0.67 <= rand < 0.85:
241 self.random_action_count = 4
242 self.non_random_action_count = 5
243 elif 0.85 <= rand < 0.95:
244 self.random_action_count = 8
245 self.non_random_action_count = 10
246 else:
247 self.random_action_count = 12
248 self.non_random_action_count = 15
249 log.debug('random actions at %r, non-random %r', self.random_action_count, self.non_random_action_count)
250
251 else:
252 self.semirandom_sequence_step += 1
253
254
255def run(experiment, env_id='DeepDrivePreproTensorflow-v0', should_record=False, net_path=None, should_benchmark=True,

Callers 1

runFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected