Skip to content

Commit

Permalink
Make miscellaneous revisions for version 1.3.5 (#828)
Browse files Browse the repository at this point in the history
* make miscellaneous revisions

* version 1.3.5

* fix pep8
  • Loading branch information
dustinvtran authored Jan 22, 2018
1 parent 6419751 commit daf086a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
28 changes: 15 additions & 13 deletions edward/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
from edward import util

# Direct imports for convenience
from edward.criticisms import evaluate, ppc, ppc_density_plot, \
ppc_stat_hist_plot
from edward.inferences import Inference, MonteCarlo, VariationalInference, \
HMC, MetropolisHastings, SGLD, SGHMC, \
KLpq, KLqp, ReparameterizationKLqp, ReparameterizationKLKLqp, \
ReparameterizationEntropyKLqp, ScoreKLqp, ScoreKLKLqp, ScoreEntropyKLqp, \
ScoreRBKLqp, WakeSleep, GANInference, BiGANInference, WGANInference, \
ImplicitKLqp, MAP, Laplace, complete_conditional, Gibbs
from edward.criticisms import (
evaluate, ppc, ppc_density_plot, ppc_stat_hist_plot)
from edward.inferences import (
Inference, MonteCarlo, VariationalInference,
HMC, MetropolisHastings, SGLD, SGHMC,
KLpq, KLqp, ReparameterizationKLqp, ReparameterizationKLKLqp,
ReparameterizationEntropyKLqp, ScoreKLqp, ScoreKLKLqp, ScoreEntropyKLqp,
ScoreRBKLqp, WakeSleep, GANInference, BiGANInference, WGANInference,
ImplicitKLqp, MAP, Laplace, complete_conditional, Gibbs)
from edward.models import RandomVariable
from edward.util import check_data, check_latent_vars, copy, dot, \
get_ancestors, get_blanket, get_children, get_control_variate_coef, \
get_descendants, get_parents, get_session, get_siblings, get_variables, \
is_independent, Progbar, random_variables, rbf, set_seed, \
to_simplex, transform
from edward.util import (
check_data, check_latent_vars, copy, dot,
get_ancestors, get_blanket, get_children, get_control_variate_coef,
get_descendants, get_parents, get_session, get_siblings, get_variables,
is_independent, Progbar, random_variables, rbf, set_seed,
to_simplex, transform)
from edward.version import __version__, VERSION

from tensorflow.python.util.all_util import remove_undocumented
Expand Down
15 changes: 8 additions & 7 deletions edward/util/random_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
from edward.models.random_variables import TransformedDistribution
from edward.models import PointMass
from edward.util.graphs import random_variables
from tensorflow.contrib.distributions import bijectors
from tensorflow.core.framework import attr_value_pb2
from tensorflow.python.framework.ops import set_shapes_for_outputs
from tensorflow.python.util import compat

tfb = tf.contrib.distributions.bijectors


def check_data(data):
"""Check that the data dictionary passed during inference and
Expand Down Expand Up @@ -809,13 +810,13 @@ def transform(x, *args, **kwargs):
x: RandomVariable.
Continuous random variable to transform.
*args, **kwargs: optional.
Arguments to overwrite when forming the ``TransformedDistribution``.
Arguments to overwrite when forming the `TransformedDistribution`.
For example, manually specify the transformation by passing in
the ``bijector`` argument.
the `bijector` argument.
Returns:
RandomVariable.
A ``TransformedDistribution`` random variable, or the provided random
A `TransformedDistribution` random variable, or the provided random
variable if no transformation was applied.
#### Examples
Expand All @@ -839,13 +840,13 @@ def transform(x, *args, **kwargs):
raise AttributeError(msg)

if support == '01':
bij = bijectors.Invert(bijectors.Sigmoid())
bij = tfb.Invert(tfb.Sigmoid())
new_support = 'real'
elif support == 'nonnegative':
bij = bijectors.Invert(bijectors.Softplus())
bij = tfb.Invert(tfb.Softplus())
new_support = 'real'
elif support == 'simplex':
bij = bijectors.Invert(bijectors.SoftmaxCentered(event_ndims=1))
bij = tfb.Invert(tfb.SoftmaxCentered(event_ndims=1))
new_support = 'multivariate_real'
elif support in ('real', 'multivariate_real'):
return x
Expand Down
2 changes: 1 addition & 1 deletion edward/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.3.4'
__version__ = '1.3.5'
VERSION = __version__

0 comments on commit daf086a

Please sign in to comment.