tensorflow_probability/python/layers/distribution_layer.py
def new(params, event_shape=(), validate_args=False, name=None):
    """Create the distribution instance from a `params` vector."""
    with tf.compat.v1.name_scope(name, 'IndependentLogistic',
                                 [params, event_shape]):
      params = tf.convert_to_tensor(value=params, name='params')
      event_shape = dist_util.expand_to_vector(
          tf.convert_to_tensor(
              value=event_shape, name='event_shape', dtype_hint=tf.int32),
          tensor_name='event_shape')
      output_shape = tf.concat([
          tf.shape(input=params)[:-1],
          event_shape,
      ],
                               axis=0)
      loc_params, scale_params = tf.split(params, 2, axis=-1)
      return tfd.Independent(
          tfd.Logistic(
              loc=tf.reshape(loc_params, output_shape),
              scale=tf.math.softplus(tf.reshape(scale_params, output_shape)),
              validate_args=validate_args),
          reinterpreted_batch_ndims=tf.size(input=event_shape),
          validate_args=validate_args)
def new(params, event_shape=(), validate_args=False, name=None):
    """Create the distribution instance from a `params` vector."""
    with tf.compat.v1.name_scope(name, 'IndependentLogistic',
                                 [params, event_shape]):
      params = tf.convert_to_tensor(value=params, name='params')
      event_shape = dist_util.expand_to_vector(
          tf.convert_to_tensor(
              value=event_shape, name='event_shape', dtype_hint=tf.int32),
          tensor_name='event_shape')
      output_shape = tf.concat([
          tf.shape(input=params)[:-1],
          event_shape,
      ],
                               axis=0)
      loc_params, scale_params = tf.split(params, 2, axis=-1)
      return tfd.Independent(
          tfd.Logistic(
              loc=tf.reshape(loc_params, output_shape),
              scale=tf.math.softplus(tf.reshape(scale_params, output_shape)),
              validate_args=validate_args),
          reinterpreted_batch_ndims=tf.size(input=event_shape),
          validate_args=validate_args)
def new ( params , event_shape = ( ) , validate_args = False , name = None ) : with tf . compat . v1 . name_scope ( name , 'IndependentLogistic' , [ params , event_shape ] ) : params = tf . convert_to_tensor ( value = params , name = 'params' ) event_shape = dist_util . expand_to_vector ( tf . convert_to_tensor ( value = event_shape , name = 'event_shape' , dtype_hint = tf . int32 ) , tensor_name = 'event_shape' ) output_shape = tf . concat ( [ tf . shape ( input = params ) [ : - 1 ] , event_shape , ] , axis = 0 ) loc_params , scale_params = tf . split ( params , 2 , axis = - 1 ) return tfd . Independent ( tfd . Logistic ( loc = tf . reshape ( loc_params , output_shape ) , scale = tf . math . softplus ( tf . reshape ( scale_params , output_shape ) ) , validate_args = validate_args ) , reinterpreted_batch_ndims = tf . size ( input = event_shape ) , validate_args = validate_args )
Create the distribution instance from a `params` vector.
Create the distribution instance from a params vector .