Exemplo n.º 1
0
def main():
    model = PolicyGradient(
        gym.make('CartPole-v1'),
        n_in=4,
        hidden_net=lambda x: tf.layers.dense(x, 10, tf.nn.elu),
        n_out=2)
    model.learn()
    model.play()
Exemplo n.º 2
0
def main():
    model = PolicyGradient()
    model.learn(gym.make("CartPole-v0"))
    model.play(gym.make("CartPole-v0"))
Exemplo n.º 3
0
def main():
    model = PolicyGradient(gym.make('CartPole-v1'),
                           n_in=4, n_hidden=[10], n_out=2)
    model.learn()
    model.play()
Exemplo n.º 4
0
def main():
    model = PolicyGradient(lambda x: tf.layers.dense(x, 4, tf.nn.relu))
    model.learn(gym.make("CartPole-v0"))
    model.play(gym.make("CartPole-v0"))