Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
import numpy as np
import gym
from gym.spaces import Discrete, Box
def mlp(x, sizes, activation=tf.tanh, output_activation=None):
# Build a feedforward neural network.
for size in sizes[:-1]:
x = tf.layers.dense(x, units=size, activation=activation)
return tf.layers.dense(x, units=sizes[-1], activation=output_activation)
import tensorflow as tf
import numpy as np
import gym
from gym.spaces import Discrete, Box
def mlp(x, sizes, activation=tf.tanh, output_activation=None):
# Build a feedforward neural network.
for size in sizes[:-1]:
x = tf.layers.dense(x, units=size, activation=activation)
return tf.layers.dense(x, units=sizes[-1], activation=output_activation)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.