Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
174f63eb
Commit
174f63eb
authored
2 years ago
by
Gordian Edenhofer
Browse files
Options
Downloads
Patches
Plain Diff
re.kl.py: Fix tables in docstrings
parent
3525c88d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!780
Fix docstring formatting
Pipeline
#132848
passed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/re/kl.py
+8
-12
8 additions, 12 deletions
src/re/kl.py
with
8 additions
and
12 deletions
src/re/kl.py
+
8
−
12
View file @
174f63eb
...
...
@@ -32,6 +32,7 @@ def cond_raise(condition, exception):
call
(
maybe_raise
,
condition
,
result_shape
=
None
)
# TODO (?): optionally accept ham.metric and likelihood.lsm
def
_sample_standard_hamiltonian
(
hamiltonian
:
StandardHamiltonian
,
primals
,
...
...
@@ -144,6 +145,7 @@ def sample_standard_hamiltonian(
return
inv_met_smpl
# TODO (?): optionally accept ham.metric and likelihood.lsm and likelihood.transformation
def
geometrically_sample_standard_hamiltonian
(
hamiltonian
:
StandardHamiltonian
,
primals
,
...
...
@@ -400,7 +402,6 @@ def MetricKL(
Parameters
----------
hamiltonian : :class:`nifty8.src.re.likelihood.StandardHamiltonian`
Hamiltonian of the approximated probability distribution.
primals : :class:`nifty8.re.field.Field`
...
...
@@ -409,7 +410,7 @@ def MetricKL(
Number of samples used to stochastically estimate the KL.
key : DeviceArray
A PRNG-key.
mirror_samples : bool
ean
mirror_samples : bool
Whether the mirrored version of the drawn samples are also used.
If true, the number of used samples doubles.
Mirroring samples stabilizes the KL estimate as extreme
...
...
@@ -420,10 +421,8 @@ def MetricKL(
itself. The function is used to map the drawing of samples. Possible
string-keys are:
keys - functions
-------------------------------------
'
pmap
'
or
'
p
'
- jax.pmap
'
lax.map
'
or
'
lax
'
- jax.lax.map
-
'
pmap
'
or
'
p
'
for `jax.pmap`
-
'
lax.map
'
or
'
lax
'
for `jax.lax.map`
In case sample_mapping is passed as a function, it should produce a
mapped function f_mapped of a general function f as: `f_mapped =
...
...
@@ -557,7 +556,6 @@ def mean_value_and_grad(ham: Callable, sample_mapping='vmap', *args, **kwargs):
Parameters
----------
ham : :class:`nifty8.src.re.likelihood.StandardHamiltonian`
Hamiltonian of the approximated probability distribution,
of which the mean value and the mean gradient are to be computed.
...
...
@@ -566,11 +564,9 @@ def mean_value_and_grad(ham: Callable, sample_mapping='vmap', *args, **kwargs):
itself. The function is used to map the drawing of samples. Possible
string-keys are:
keys - functions
-------------------------------------
'
vmap
'
or
'
v
'
- jax.vmap
'
pmap
'
or
'
p
'
- jax.pmap
'
lax.map
'
or
'
lax
'
- jax.lax.map
-
'
vmap
'
or
'
v
'
for `jax.vmap`
-
'
pmap
'
or
'
p
'
for `jax.pmap`
-
'
lax.map
'
or
'
lax
'
for `jax.lax.map`
In case sample_mapping is passed as a function, it should produce a
mapped function f_mapped of a general function f as: `f_mapped =
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment