Skip to content

Commit

Permalink
doc: fix doc string formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MArpogaus committed Jul 18, 2024
1 parent cfbdaff commit 9ad122e
Show file tree
Hide file tree
Showing 3 changed files with 348 additions and 281 deletions.
31 changes: 17 additions & 14 deletions src/bernstein_flow/bijectors/bernstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# author : Marcel Arpogaus <[email protected]>
#
# created : 2024-07-12 14:52:28 (Marcel Arpogaus)
# changed : 2024-07-12 14:52:28 (Marcel Arpogaus)
# changed : 2024-07-18 12:01:50 (Marcel Arpogaus)

# %% License ###################################################################
# Copyright 2020 Marcel Arpogaus
Expand Down Expand Up @@ -47,11 +47,8 @@ class BernsteinPolynomial(tfp.experimental.bijectors.ScalarFunctionWithInferredI
Attributes
----------
thetas: The Bernstein coefficients.
extrapolation: The method to extrapolate outside of bounds.
analytic_jacobian: Whether to use the analytic Jacobian.
domain: The domain of the Bernstein polynomial.
name: The name to give Ops created by the initializer.
thetas
The Bernstein coefficients.
"""

Expand All @@ -66,14 +63,20 @@ def __init__(
) -> None:
"""Construct a new instance of a Bernstein polynomial bijector.
Args:
----
thetas: The Bernstein coefficients.
extrapolation: The method to extrapolate outside of bounds.
analytic_jacobian: Whether to use the analytic Jacobian.
domain: The domain of the Bernstein polynomial.
name: The name to give Ops created by the initializer.
kwargs: Keyword arguments for the parent class.
Parameters
----------
thetas
The Bernstein coefficients.
extrapolation
The method to extrapolate outside of bounds.
analytic_jacobian
Whether to use the analytic Jacobian.
domain
The domain of the Bernstein polynomial.
name
The name to give Ops created by the initializer.
kwargs
Keyword arguments for the parent class.
"""
with tf.name_scope(name) as name:
Expand Down
Loading

4 comments on commit 9ad122e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old Faithful

Learning Curve

Metrics

Min of loss: -0.5414577126502991

Parameter Vector

a1 = array([8.587191], dtype=float32)
b1 = array([-0.6394334], dtype=float32)
thetas = array([-0.14062491, -0.10752842, -0.07443193,  0.5046902 ,  0.5061893 ,
    0.5069164 ,  0.51237553,  0.60962963,  0.808342  ,  0.86528236,
    1.0068079 ,  1.1483335 ], dtype=float32)

Flow

Results

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bimodal Model

Learning Curve

Learning Curve

Metrics

loss: -0.8461853265762329
val_loss: -0.8872666358947754

Results

Parameter Vector for x = 1

BernsteinFlow:
invert_chain_of_bernstein_bijector_of_scale1_of_shift1:
chain_of_bernstein_bijector_of_scale1_of_shift1:
bernstein_bijector: [-3.0004537 -2.1094272 -1.2184007 -1.1540174 -0.31541258 -0.05092421
-0.0509142 -0.0509042 -0.0508942 -0.0508842 -0.0508742 -0.0508642
-0.05085421 -0.0508442 -0.05083418 -0.0508241 -0.05080812 4.6214027
9.293613 ]
scale1: 0.47735607624053955
shift1: 0.6625609993934631

Flow



Bijector


@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old Faithful

Learning Curve

Metrics

Min of loss: -0.5240349173545837

Parameter Vector

a1 = array([6.8693], dtype=float32)
b1 = array([-0.6399276], dtype=float32)
thetas = array([-0.1558678 , -0.11459249, -0.07331719,  0.55252224,  0.5545017 ,
    0.555892  ,  0.57479364,  0.7909599 ,  0.97666967,  1.0816667 ,
    1.2693859 ,  1.4571052 ], dtype=float32)

Flow

Results

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bimodal Model

Learning Curve

Learning Curve

Metrics

loss: -0.8773936033248901
val_loss: -0.9069622755050659

Results

Parameter Vector for x = 1

BernsteinFlow:
invert_chain_of_bernstein_bijector_of_scale1_of_shift1:
chain_of_bernstein_bijector_of_scale1_of_shift1:
bernstein_bijector: [-3.0000000e+00 -2.1008563e+00 -1.2017126e+00 -1.0802743e+00
-2.7844787e-02 -2.7834786e-02 -2.7824786e-02 -2.7814785e-02
-2.7804784e-02 -2.7794784e-02 -2.7784783e-02 -2.7774783e-02
-2.7764782e-02 -2.7754782e-02 -2.7744781e-02 -2.7734781e-02
-2.7397374e-02 1.5316508e+01 3.0660414e+01]
scale1: 0.45770955085754395
shift1: 0.607999324798584

Flow



Bijector


Please sign in to comment.