Skip to main content
Ctrl+K
TorchDR 0.2 documentation - Home TorchDR 0.2 documentation - Home
  • Torch Dimensionality Reduction
  • User Guide
  • API and Modules
  • Gallery
  • Releases
    • Contributing
    • Bibliography
  • GitHub
  • PyPI
  • Torch Dimensionality Reduction
  • User Guide
  • API and Modules
  • Gallery
  • Releases
  • Contributing
  • Bibliography
  • GitHub
  • PyPI

Section Navigation

  • PCA
  • KernelPCA
  • IncrementalPCA
  • SNE
  • TSNE
  • TSNEkhorn
  • InfoTSNE
  • LargeVis
  • UMAP
  • DRModule
  • AffinityMatcher
  • NeighborEmbedding
  • SparseNeighborEmbedding
  • SampledNeighborEmbedding
  • GaussianAffinity
  • StudentAffinity
  • ScalarProductAffinity
  • NormalizedGaussianAffinity
  • NormalizedStudentAffinity
  • SelfTuningAffinity
  • MAGICAffinity
  • SinkhornAffinity
  • EntropicAffinity
  • SymmetricEntropicAffinity
  • DoublyStochasticQuadraticAffinity
  • UMAPAffinityIn
  • UMAPAffinityOut
  • silhouette_score
  • pairwise_distances
  • binary_search
  • false_position
  • API and Modules
  • binary_search

binary_search#

torchdr.binary_search(f, n, begin=None, end=None, max_iter=1000, tol=1e-09, verbose=False, dtype=torch.float32)[source]#

Implement the binary search root finding method.

Perform a batched binary search to find the root of an increasing function f. The domain of f is restricted to positive floats.

Parameters:
  • f (function \(\mathbb{R}_{>0} \to \mathbb{R}\)) – batched 1d increasing function which root should be computed.

  • n (int) – size of the input of f.

  • begin (float or torch.Tensor of shape (n), optional) – initial lower bound of the root.

  • end (float or torch.Tensor of shape (n), optional) – initial upper bound of the root.

  • max_iter (int, optional) – maximum iterations of search.

  • tol (float, optional) – precision threshold at which the algorithm stops.

  • verbose (bool, optional) – if True, prints current bounds.

  • dtype (torch.dtype, optional) – data type of the input.

Returns:

m – root of f.

Return type:

torch.Tensor of shape (n)

previous

pairwise_distances

next

false_position

On this page
  • binary_search()

This Page

  • Show Source

© Copyright 2024, TorchDR team.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.