planet/networks/basic.py
def feed_forward(
    state, data_shape, num_layers=2, activation=None, cut_gradient=False):
  """Create a model returning unnormalized MSE distribution."""
  hidden = state
  if cut_gradient:
    hidden = tf.stop_gradient(hidden)
  for _ in range(num_layers):
    hidden = tf.layers.dense(hidden, 100, tf.nn.relu)
  mean = tf.layers.dense(hidden, int(np.prod(data_shape)), activation)
  mean = tf.reshape(mean, tools.shape(state)[:-1] + data_shape)
  dist = tools.MSEDistribution(mean)
  dist = tfd.Independent(dist, len(data_shape))
  return dist
Create a model returning unnormalized MSE distribution.
Create a model returning unnormalized MSE distribution.
Create a model returning unnormalized MSE distribution .
def feed_forward(
    state, data_shape, num_layers=2, activation=None, cut_gradient=False):
  hidden = state
  if cut_gradient:
    hidden = tf.stop_gradient(hidden)
  for _ in range(num_layers):
    hidden = tf.layers.dense(hidden, 100, tf.nn.relu)
  mean = tf.layers.dense(hidden, int(np.prod(data_shape)), activation)
  mean = tf.reshape(mean, tools.shape(state)[:-1] + data_shape)
  dist = tools.MSEDistribution(mean)
  dist = tfd.Independent(dist, len(data_shape))
  return dist
def feed_forward ( state , data_shape , num_layers = 2 , activation = None , cut_gradient = False ) : hidden = state if cut_gradient : hidden = tf . stop_gradient ( hidden ) for _ in range ( num_layers ) : hidden = tf . layers . dense ( hidden , 100 , tf . nn . relu ) mean = tf . layers . dense ( hidden , int ( np . prod ( data_shape ) ) , activation ) mean = tf . reshape ( mean , tools . shape ( state ) [ : - 1 ] + data_shape ) dist = tools . MSEDistribution ( mean ) dist = tfd . Independent ( dist , len ( data_shape ) ) return dist
Create a model returning unnormalized MSE distribution.
Create a model returning unnormalized MSE distribution .
"""Create a model returning unnormalized MSE distribution."""
state
data_shape
num_layers
activation
cut_gradient