MCPcopy Create free account
hub / github.com/rushter/MLAlgorithms / init_environment

Method init_environment

mla/rl/dqn.py:55–66  ·  view source on GitHub ↗
(self, name="CartPole-v0", monitor=False)

Source from the content-addressed store, hash-verified

53 self.decay = decay
54
55 def init_environment(self, name="CartPole-v0", monitor=False):
56 self.env = gym.make(name)
57 if monitor:
58 self.env = wrappers.Monitor(
59 self.env, name, force=True, video_callable=False
60 )
61
62 self.n_states = self.env.observation_space.shape[0]
63 self.n_actions = self.env.action_space.n
64
65 # Experience replay
66 self.replay = []
67
68 def init_model(self, model):
69 self.model = model(self.n_actions, self.batch_size)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected