Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
ffb9714f
Commit
ffb9714f
authored
Jan 17, 2019
by
Martin Reinecke
Browse files
Merge branch 'mr_docs' into 'NIFTy_5'
attempt to document probe_diagonal() See merge request ift/nifty-dev!184
parents
49987c9e
60ba4c50
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/energy_operators.py
View file @
ffb9714f
...
...
@@ -318,7 +318,7 @@ class Hamiltonian(EnergyOperator):
class
AveragedEnergy
(
EnergyOperator
):
"""Computes Kullbac
h
-Leibler (KL) divergence or Gibbs free energies.
"""Computes Kullbac
k
-Leibler (KL) divergence or Gibbs free energies.
A sample-averaged energy, e.g. an Hamiltonian, approximates the relevant
part of a KL to be used in Variational Bayes inference if the samples are
...
...
nifty5/probing.py
View file @
ffb9714f
...
...
@@ -107,8 +107,27 @@ def probe_with_posterior_samples(op, post_op, nprobes):
def
probe_diagonal
(
op
,
nprobes
,
random_type
=
"pm1"
):
'''
FIXME
'''Probes the diagonal of an endomorphic operator.
The operator is called on a user-specified number of randomly generated
input vectors :math:`v_i`, producing :math:`r_i`. The estimated diagonal
is the mean of :math:`r_i^\dagger v_i`.
Parameters
----------
op: EndomorphicOperator
The operator to be probed.
nprobes: int
The number of probes to be used.
random_type: str
The kind of random number distribution to be used for the probing.
The default value `pm1` causes the probing vector to be randomly
filled with values of +1 and -1.
Returns
-------
Field
The estimated diagonal.
'''
sc
=
StatCalculator
()
for
i
in
range
(
nprobes
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment