Skip to content

Commit daf086a

Browse files
authored
Make miscellaneous revisions for version 1.3.5 (#828)
* make miscellaneous revisions * version 1.3.5 * fix pep8
1 parent 6419751 commit daf086a

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

edward/__init__.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@
88
from edward import util
99

1010
# Direct imports for convenience
11-
from edward.criticisms import evaluate, ppc, ppc_density_plot, \
12-
ppc_stat_hist_plot
13-
from edward.inferences import Inference, MonteCarlo, VariationalInference, \
14-
HMC, MetropolisHastings, SGLD, SGHMC, \
15-
KLpq, KLqp, ReparameterizationKLqp, ReparameterizationKLKLqp, \
16-
ReparameterizationEntropyKLqp, ScoreKLqp, ScoreKLKLqp, ScoreEntropyKLqp, \
17-
ScoreRBKLqp, WakeSleep, GANInference, BiGANInference, WGANInference, \
18-
ImplicitKLqp, MAP, Laplace, complete_conditional, Gibbs
11+
from edward.criticisms import (
12+
evaluate, ppc, ppc_density_plot, ppc_stat_hist_plot)
13+
from edward.inferences import (
14+
Inference, MonteCarlo, VariationalInference,
15+
HMC, MetropolisHastings, SGLD, SGHMC,
16+
KLpq, KLqp, ReparameterizationKLqp, ReparameterizationKLKLqp,
17+
ReparameterizationEntropyKLqp, ScoreKLqp, ScoreKLKLqp, ScoreEntropyKLqp,
18+
ScoreRBKLqp, WakeSleep, GANInference, BiGANInference, WGANInference,
19+
ImplicitKLqp, MAP, Laplace, complete_conditional, Gibbs)
1920
from edward.models import RandomVariable
20-
from edward.util import check_data, check_latent_vars, copy, dot, \
21-
get_ancestors, get_blanket, get_children, get_control_variate_coef, \
22-
get_descendants, get_parents, get_session, get_siblings, get_variables, \
23-
is_independent, Progbar, random_variables, rbf, set_seed, \
24-
to_simplex, transform
21+
from edward.util import (
22+
check_data, check_latent_vars, copy, dot,
23+
get_ancestors, get_blanket, get_children, get_control_variate_coef,
24+
get_descendants, get_parents, get_session, get_siblings, get_variables,
25+
is_independent, Progbar, random_variables, rbf, set_seed,
26+
to_simplex, transform)
2527
from edward.version import __version__, VERSION
2628

2729
from tensorflow.python.util.all_util import remove_undocumented

edward/util/random_variables.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
from edward.models.random_variables import TransformedDistribution
1212
from edward.models import PointMass
1313
from edward.util.graphs import random_variables
14-
from tensorflow.contrib.distributions import bijectors
1514
from tensorflow.core.framework import attr_value_pb2
1615
from tensorflow.python.framework.ops import set_shapes_for_outputs
1716
from tensorflow.python.util import compat
1817

18+
tfb = tf.contrib.distributions.bijectors
19+
1920

2021
def check_data(data):
2122
"""Check that the data dictionary passed during inference and
@@ -809,13 +810,13 @@ def transform(x, *args, **kwargs):
809810
x: RandomVariable.
810811
Continuous random variable to transform.
811812
*args, **kwargs: optional.
812-
Arguments to overwrite when forming the ``TransformedDistribution``.
813+
Arguments to overwrite when forming the `TransformedDistribution`.
813814
For example, manually specify the transformation by passing in
814-
the ``bijector`` argument.
815+
the `bijector` argument.
815816
816817
Returns:
817818
RandomVariable.
818-
A ``TransformedDistribution`` random variable, or the provided random
819+
A `TransformedDistribution` random variable, or the provided random
819820
variable if no transformation was applied.
820821
821822
#### Examples
@@ -839,13 +840,13 @@ def transform(x, *args, **kwargs):
839840
raise AttributeError(msg)
840841

841842
if support == '01':
842-
bij = bijectors.Invert(bijectors.Sigmoid())
843+
bij = tfb.Invert(tfb.Sigmoid())
843844
new_support = 'real'
844845
elif support == 'nonnegative':
845-
bij = bijectors.Invert(bijectors.Softplus())
846+
bij = tfb.Invert(tfb.Softplus())
846847
new_support = 'real'
847848
elif support == 'simplex':
848-
bij = bijectors.Invert(bijectors.SoftmaxCentered(event_ndims=1))
849+
bij = tfb.Invert(tfb.SoftmaxCentered(event_ndims=1))
849850
new_support = 'multivariate_real'
850851
elif support in ('real', 'multivariate_real'):
851852
return x

edward/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '1.3.4'
1+
__version__ = '1.3.5'
22
VERSION = __version__

0 commit comments

Comments
 (0)