tfp.math.bracket_root
Stay organized with collections
Save and categorize content based on your preferences.
Finds bounds that bracket a root of the objective function.
tfp.math.bracket_root(
objective_fn,
dtype=tf.float32,
num_points=512,
name='bracket_root'
)
This method attempts to return an interval bracketing a root of the objective
function. It evaluates the objective in parallel at num_points
locations, at exponentially increasing distance from the origin, and returns
the first pair of adjacent points [low, high]
such that the objective is
finite and has a different sign at the two points. If no such pair was
observed, it returns the trivial interval
[np.finfo(dtype).min, np.finfo(dtype).max]
containing all float values of
the specified dtype
. If the objective has multiple
roots, the returned interval will contain at least one (but perhaps not all)
of the roots.
Args |
objective_fn
|
Python callable for which roots are searched. It must be a
continuous function that accepts a scalar Tensor of type dtype and
returns a Tensor of shape batch_shape .
|
dtype
|
Optional float dtype of inputs to objective_fn .
Default value: tf.float32 .
|
num_points
|
Optional Python int number of points at which to evaluate
the objective.
Default value: 512 .
|
name
|
Python str name given to ops created by this method.
|
Returns |
low
|
Float Tensor of shape batch_shape and dtype dtype . Lower bound
on a root of objective_fn .
|
high
|
Float Tensor of shape batch_shape and dtype dtype . Upper bound
on a root of objective_fn .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[]]