Skip to content

Commit

Permalink
CircleCI update of dev docs (2703).
Browse files Browse the repository at this point in the history
  • Loading branch information
Circle CI authored and Circle CI committed Jul 10, 2024
1 parent acaf9fe commit de84f49
Show file tree
Hide file tree
Showing 377 changed files with 732,311 additions and 732,451 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified master/_images/sphx_glr_plot_COOT_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_COOT_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_EWCA_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_EWCA_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_EWCA_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_Intro_OT_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_Intro_OT_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_Intro_OT_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_Intro_OT_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_Intro_OT_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_Intro_OT_006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_smooth_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_smooth_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_smooth_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_smooth_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_1D_smooth_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_006.png
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_007.png
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_008.png
Binary file modified master/_images/sphx_glr_plot_OT_2D_samples_thumb.png
Binary file modified master/_images/sphx_glr_plot_OT_L1_vs_L2_001.png
Binary file modified master/_images/sphx_glr_plot_OT_L1_vs_L2_002.png
Binary file modified master/_images/sphx_glr_plot_OT_L1_vs_L2_003.png
Binary file modified master/_images/sphx_glr_plot_OT_L1_vs_L2_004.png
Binary file modified master/_images/sphx_glr_plot_OT_L1_vs_L2_005.png
Binary file modified master/_images/sphx_glr_plot_OT_L1_vs_L2_006.png
Binary file modified master/_images/sphx_glr_plot_SSNB_001.png
Binary file modified master/_images/sphx_glr_plot_SSNB_002.png
Binary file modified master/_images/sphx_glr_plot_SSNB_003.png
Binary file modified master/_images/sphx_glr_plot_SSNB_004.png
Binary file modified master/_images/sphx_glr_plot_UOT_1D_001.png
Binary file modified master/_images/sphx_glr_plot_UOT_1D_002.png
Binary file modified master/_images/sphx_glr_plot_UOT_1D_003.png
Binary file modified master/_images/sphx_glr_plot_UOT_1D_004.png
Binary file modified master/_images/sphx_glr_plot_UOT_barycenter_1D_001.png
Binary file modified master/_images/sphx_glr_plot_UOT_barycenter_1D_002.png
Binary file modified master/_images/sphx_glr_plot_UOT_barycenter_1D_003.png
Binary file modified master/_images/sphx_glr_plot_UOT_barycenter_1D_004.png
Binary file modified master/_images/sphx_glr_plot_WDA_001.png
Binary file modified master/_images/sphx_glr_plot_WDA_002.png
Binary file modified master/_images/sphx_glr_plot_WeakOT_VS_OT_001.png
Binary file modified master/_images/sphx_glr_plot_WeakOT_VS_OT_002.png
Binary file modified master/_images/sphx_glr_plot_WeakOT_VS_OT_003.png
Binary file modified master/_images/sphx_glr_plot_WeakOT_VS_OT_004.png
Binary file modified master/_images/sphx_glr_plot_barycenter_1D_001.png
Binary file modified master/_images/sphx_glr_plot_barycenter_1D_002.png
Binary file modified master/_images/sphx_glr_plot_barycenter_1D_003.png
Binary file modified master/_images/sphx_glr_plot_barycenter_fgw_001.png
Binary file modified master/_images/sphx_glr_plot_barycenter_fgw_002.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_001.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_002.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_003.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_004.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_005.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_006.png
Binary file modified master/_images/sphx_glr_plot_barycenter_lp_vs_entropic_007.png
Binary file modified master/_images/sphx_glr_plot_compute_emd_001.png
Binary file modified master/_images/sphx_glr_plot_compute_emd_002.png
Binary file modified master/_images/sphx_glr_plot_compute_emd_003.png
Binary file modified master/_images/sphx_glr_plot_compute_wasserstein_circle_001.png
Binary file modified master/_images/sphx_glr_plot_compute_wasserstein_circle_002.png
Binary file modified master/_images/sphx_glr_plot_compute_wasserstein_circle_003.png
Binary file modified master/_images/sphx_glr_plot_compute_wasserstein_circle_004.png
Binary file modified master/_images/sphx_glr_plot_convolutional_barycenter_001.png
Binary file modified master/_images/sphx_glr_plot_debiased_barycenter_001.png
Binary file modified master/_images/sphx_glr_plot_debiased_barycenter_002.png
Binary file modified master/_images/sphx_glr_plot_debiased_barycenter_003.png
Binary file modified master/_images/sphx_glr_plot_dmmot_001.png
Binary file modified master/_images/sphx_glr_plot_dmmot_002.png
Binary file modified master/_images/sphx_glr_plot_dmmot_003.png
Binary file modified master/_images/sphx_glr_plot_dmmot_004.png
Binary file modified master/_images/sphx_glr_plot_dmmot_005.png
Binary file modified master/_images/sphx_glr_plot_dual_ot_pytorch_001.png
Binary file modified master/_images/sphx_glr_plot_dual_ot_pytorch_002.png
Binary file modified master/_images/sphx_glr_plot_dual_ot_pytorch_003.png
Binary file modified master/_images/sphx_glr_plot_dual_ot_pytorch_004.png
Binary file modified master/_images/sphx_glr_plot_dual_ot_pytorch_005.png
Binary file modified master/_images/sphx_glr_plot_dual_ot_pytorch_thumb.png
Binary file modified master/_images/sphx_glr_plot_entropic_semirelaxed_fgw_001.png
Binary file modified master/_images/sphx_glr_plot_entropic_semirelaxed_fgw_002.png
Binary file modified master/_images/sphx_glr_plot_factored_coupling_001.png
Binary file modified master/_images/sphx_glr_plot_factored_coupling_002.png
Binary file modified master/_images/sphx_glr_plot_factored_coupling_thumb.png
Binary file modified master/_images/sphx_glr_plot_fgw_001.png
Binary file modified master/_images/sphx_glr_plot_fgw_002.png
Binary file modified master/_images/sphx_glr_plot_fgw_003.png
Binary file modified master/_images/sphx_glr_plot_fgw_solvers_001.png
Binary file modified master/_images/sphx_glr_plot_fgw_solvers_thumb.png
Binary file modified master/_images/sphx_glr_plot_free_support_barycenter_001.png
Binary file modified master/_images/sphx_glr_plot_free_support_barycenter_002.png
Binary file modified master/_images/sphx_glr_plot_free_support_barycenter_003.png
Binary file modified master/_images/sphx_glr_plot_gaussian_barycenter_001.png
Binary file modified master/_images/sphx_glr_plot_gaussian_barycenter_002.png
Binary file modified master/_images/sphx_glr_plot_gnn_TFGW_001.png
Binary file modified master/_images/sphx_glr_plot_gnn_TFGW_002.png
Binary file modified master/_images/sphx_glr_plot_gnn_TFGW_003.png
Binary file modified master/_images/sphx_glr_plot_gromov_001.png
Binary file modified master/_images/sphx_glr_plot_gromov_002.png
Binary file modified master/_images/sphx_glr_plot_gromov_003.png
Binary file modified master/_images/sphx_glr_plot_gromov_004.png
Binary file modified master/_images/sphx_glr_plot_gromov_barycenter_001.png
Binary file modified master/_images/sphx_glr_plot_learning_weights_with_COOT_001.png
Binary file modified master/_images/sphx_glr_plot_learning_weights_with_COOT_002.png
Binary file modified master/_images/sphx_glr_plot_learning_weights_with_COOT_003.png
Binary file modified master/_images/sphx_glr_plot_logo_001.png
Binary file modified master/_images/sphx_glr_plot_logo_002.png
Binary file modified master/_images/sphx_glr_plot_lowrank_GW_001.png
Binary file modified master/_images/sphx_glr_plot_lowrank_GW_002.png
Binary file modified master/_images/sphx_glr_plot_lowrank_GW_003.png
Binary file modified master/_images/sphx_glr_plot_lowrank_sinkhorn_001.png
Binary file modified master/_images/sphx_glr_plot_lowrank_sinkhorn_002.png
Binary file modified master/_images/sphx_glr_plot_optim_OTreg_001.png
Binary file modified master/_images/sphx_glr_plot_optim_OTreg_002.png
Binary file modified master/_images/sphx_glr_plot_optim_OTreg_003.png
Binary file modified master/_images/sphx_glr_plot_optim_OTreg_004.png
Binary file modified master/_images/sphx_glr_plot_optim_OTreg_005.png
Binary file modified master/_images/sphx_glr_plot_optim_gromov_pytorch_001.png
Binary file modified master/_images/sphx_glr_plot_optim_gromov_pytorch_002.png
Binary file modified master/_images/sphx_glr_plot_optim_gromov_pytorch_003.png
Binary file modified master/_images/sphx_glr_plot_optim_gromov_pytorch_004.png
Binary file modified master/_images/sphx_glr_plot_optim_gromov_pytorch_005.png
Binary file modified master/_images/sphx_glr_plot_otda_classes_001.png
Binary file modified master/_images/sphx_glr_plot_otda_classes_002.png
Binary file modified master/_images/sphx_glr_plot_otda_color_images_001.png
Binary file modified master/_images/sphx_glr_plot_otda_color_images_002.png
Binary file modified master/_images/sphx_glr_plot_otda_color_images_003.png
Binary file modified master/_images/sphx_glr_plot_otda_d2_001.png
Binary file modified master/_images/sphx_glr_plot_otda_d2_002.png
Binary file modified master/_images/sphx_glr_plot_otda_d2_003.png
Binary file modified master/_images/sphx_glr_plot_otda_jcpot_001.png
Binary file modified master/_images/sphx_glr_plot_otda_jcpot_002.png
Binary file modified master/_images/sphx_glr_plot_otda_jcpot_003.png
Binary file modified master/_images/sphx_glr_plot_otda_jcpot_004.png
Binary file modified master/_images/sphx_glr_plot_otda_laplacian_001.png
Binary file modified master/_images/sphx_glr_plot_otda_laplacian_002.png
Binary file modified master/_images/sphx_glr_plot_otda_linear_mapping_001.png
Binary file modified master/_images/sphx_glr_plot_otda_linear_mapping_002.png
Binary file modified master/_images/sphx_glr_plot_otda_linear_mapping_003.png
Binary file modified master/_images/sphx_glr_plot_otda_mapping_001.png
Binary file modified master/_images/sphx_glr_plot_otda_mapping_002.png
Binary file modified master/_images/sphx_glr_plot_otda_mapping_colors_images_001.png
Binary file modified master/_images/sphx_glr_plot_otda_mapping_colors_images_002.png
Binary file modified master/_images/sphx_glr_plot_otda_mapping_colors_images_003.png
Binary file modified master/_images/sphx_glr_plot_otda_semi_supervised_001.png
Binary file modified master/_images/sphx_glr_plot_otda_semi_supervised_002.png
Binary file modified master/_images/sphx_glr_plot_otda_semi_supervised_003.png
Binary file modified master/_images/sphx_glr_plot_partial_wass_and_gromov_001.png
Binary file modified master/_images/sphx_glr_plot_partial_wass_and_gromov_002.png
Binary file modified master/_images/sphx_glr_plot_partial_wass_and_gromov_003.png
Binary file modified master/_images/sphx_glr_plot_partial_wass_and_gromov_004.png
Binary file modified master/_images/sphx_glr_plot_regpath_001.png
Binary file modified master/_images/sphx_glr_plot_regpath_002.png
Binary file modified master/_images/sphx_glr_plot_regpath_004.png
Binary file modified master/_images/sphx_glr_plot_screenkhorn_1D_001.png
Binary file modified master/_images/sphx_glr_plot_screenkhorn_1D_002.png
Binary file modified master/_images/sphx_glr_plot_screenkhorn_1D_003.png
Binary file modified master/_images/sphx_glr_plot_semirelaxed_fgw_001.png
Binary file modified master/_images/sphx_glr_plot_semirelaxed_fgw_002.png
Binary file modified master/_images/sphx_glr_plot_sliced_wass_grad_flow_pytorch_004.png
Binary file modified master/_images/sphx_glr_plot_solve_variants_001.png
Binary file modified master/_images/sphx_glr_plot_solve_variants_002.png
Binary file modified master/_images/sphx_glr_plot_solve_variants_003.png
Binary file modified master/_images/sphx_glr_plot_ssw_unif_torch_001.png
Binary file modified master/_images/sphx_glr_plot_ssw_unif_torch_002.png
Binary file modified master/_images/sphx_glr_plot_ssw_unif_torch_003.png
Binary file modified master/_images/sphx_glr_plot_ssw_unif_torch_thumb.png
Binary file modified master/_images/sphx_glr_plot_stoch_continuous_ot_pytorch_001.png
Binary file modified master/_images/sphx_glr_plot_stoch_continuous_ot_pytorch_002.png
Binary file modified master/_images/sphx_glr_plot_stoch_continuous_ot_pytorch_003.png
Binary file modified master/_images/sphx_glr_plot_stochastic_001.png
Binary file modified master/_images/sphx_glr_plot_stochastic_002.png
Binary file modified master/_images/sphx_glr_plot_stochastic_003.png
Binary file modified master/_images/sphx_glr_plot_stochastic_004.png
Binary file modified master/_images/sphx_glr_plot_stochastic_005.png
Binary file modified master/_images/sphx_glr_plot_unbalanced_OT_001.png
Binary file modified master/_images/sphx_glr_plot_unmix_optim_torch_001.png
Binary file modified master/_images/sphx_glr_plot_unmix_optim_torch_002.png
Binary file modified master/_images/sphx_glr_plot_unmix_optim_torch_003.png
Binary file modified master/_images/sphx_glr_plot_variance_001.png
Binary file modified master/_images/sphx_glr_plot_variance_002.png
Binary file modified master/_images/sphx_glr_plot_variance_ssw_001.png
Binary file modified master/_images/sphx_glr_plot_variance_ssw_002.png
Binary file modified master/_images/sphx_glr_plot_wass1d_torch_001.png
Binary file modified master/_images/sphx_glr_plot_wass1d_torch_002.png
Binary file modified master/_images/sphx_glr_plot_wass1d_torch_003.png
Binary file modified master/_images/sphx_glr_plot_wass1d_torch_004.png
Binary file modified master/_images/sphx_glr_plot_wass2_gan_torch_001.png
Binary file modified master/_images/sphx_glr_plot_wass2_gan_torch_002.png
Binary file modified master/_images/sphx_glr_plot_wass2_gan_torch_003.png
Binary file modified master/_images/sphx_glr_plot_wass2_gan_torch_005.png
42 changes: 29 additions & 13 deletions master/_modules/ot/backend.html
Original file line number Diff line number Diff line change
Expand Up @@ -1257,16 +1257,17 @@ <h1>Source code for ot.backend</h1><div class="highlight"><pre>

<div class="viewcode-block" id="Backend.kl_div">
<a class="viewcode-back" href="../../gen_modules/ot.backend.html#ot.backend.Backend.kl_div">[docs]</a>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Computes the Kullback-Leibler divergence.</span>
<span class="sd"> Computes the (Generalized) Kullback-Leibler divergence.</span>

<span class="sd"> This function follows the api from :any:`scipy.stats.entropy`.</span>

<span class="sd"> Parameter eps is used to avoid numerical errors and is added in the log.</span>

<span class="sd"> .. math::</span>
<span class="sd"> KL(p,q) = \sum_i p(i) \log (\frac{p(i)}{q(i)}+\epsilon)</span>
<span class="sd"> KL(p,q) = \langle \mathbf{p}, log(\mathbf{p} / \mathbf{q} + eps \rangle</span>
<span class="sd"> + \mathbb{1}_{mass=True} \langle \mathbf{q} - \mathbf{p}, \mathbf{1} \rangle</span>

<span class="sd"> See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.entropy.html</span>
<span class="sd"> &quot;&quot;&quot;</span>
Expand Down Expand Up @@ -1908,8 +1909,11 @@ <h1>Source code for ot.backend</h1><div class="highlight"><pre>

<div class="viewcode-block" id="NumpyBackend.kl_div">
<a class="viewcode-back" href="../../gen_modules/ot.backend.html#ot.backend.NumpyBackend.kl_div">[docs]</a>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span></div>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span>
<span class="k">if</span> <span class="n">mass</span><span class="p">:</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">value</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">q</span> <span class="o">-</span> <span class="n">p</span><span class="p">)</span>
<span class="k">return</span> <span class="n">value</span></div>


<div class="viewcode-block" id="NumpyBackend.isfinite">
Expand Down Expand Up @@ -2550,8 +2554,11 @@ <h1>Source code for ot.backend</h1><div class="highlight"><pre>

<div class="viewcode-block" id="JaxBackend.kl_div">
<a class="viewcode-back" href="../../gen_modules/ot.backend.html#ot.backend.JaxBackend.kl_div">[docs]</a>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="k">return</span> <span class="n">jnp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">jnp</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span></div>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">jnp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">jnp</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span>
<span class="k">if</span> <span class="n">mass</span><span class="p">:</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">value</span> <span class="o">+</span> <span class="n">jnp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">q</span> <span class="o">-</span> <span class="n">p</span><span class="p">)</span>
<span class="k">return</span> <span class="n">value</span></div>


<div class="viewcode-block" id="JaxBackend.isfinite">
Expand Down Expand Up @@ -3280,8 +3287,11 @@ <h1>Source code for ot.backend</h1><div class="highlight"><pre>

<div class="viewcode-block" id="TorchBackend.kl_div">
<a class="viewcode-back" href="../../gen_modules/ot.backend.html#ot.backend.TorchBackend.kl_div">[docs]</a>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="k">return</span> <span class="n">torch</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span></div>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span>
<span class="k">if</span> <span class="n">mass</span><span class="p">:</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">value</span> <span class="o">+</span> <span class="n">torch</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">q</span> <span class="o">-</span> <span class="n">p</span><span class="p">)</span>
<span class="k">return</span> <span class="n">value</span></div>


<div class="viewcode-block" id="TorchBackend.isfinite">
Expand Down Expand Up @@ -3924,8 +3934,11 @@ <h1>Source code for ot.backend</h1><div class="highlight"><pre>

<div class="viewcode-block" id="CupyBackend.kl_div">
<a class="viewcode-back" href="../../gen_modules/ot.backend.html#ot.backend.CupyBackend.kl_div">[docs]</a>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="k">return</span> <span class="n">cp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">cp</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span></div>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">cp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">cp</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span>
<span class="k">if</span> <span class="n">mass</span><span class="p">:</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">value</span> <span class="o">+</span> <span class="n">cp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">q</span> <span class="o">-</span> <span class="n">p</span><span class="p">)</span>
<span class="k">return</span> <span class="n">value</span></div>


<div class="viewcode-block" id="CupyBackend.isfinite">
Expand Down Expand Up @@ -4591,8 +4604,11 @@ <h1>Source code for ot.backend</h1><div class="highlight"><pre>

<div class="viewcode-block" id="TensorflowBackend.kl_div">
<a class="viewcode-back" href="../../gen_modules/ot.backend.html#ot.backend.TensorflowBackend.kl_div">[docs]</a>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="k">return</span> <span class="n">tnp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">tnp</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span></div>
<span class="k">def</span> <span class="nf">kl_div</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-16</span><span class="p">):</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">tnp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="n">tnp</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">p</span> <span class="o">/</span> <span class="n">q</span> <span class="o">+</span> <span class="n">eps</span><span class="p">))</span>
<span class="k">if</span> <span class="n">mass</span><span class="p">:</span>
<span class="n">value</span> <span class="o">=</span> <span class="n">value</span> <span class="o">+</span> <span class="n">tnp</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">q</span> <span class="o">-</span> <span class="n">p</span><span class="p">)</span>
<span class="k">return</span> <span class="n">value</span></div>


<div class="viewcode-block" id="TensorflowBackend.isfinite">
Expand Down
4 changes: 2 additions & 2 deletions master/_modules/ot/bregman/_barycenter.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ <h1>Source code for ot.bregman._barycenter</h1><div class="highlight"><pre>
<span class="n">log</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;err&#39;</span><span class="p">:</span> <span class="p">[]}</span>

<span class="n">M</span> <span class="o">=</span> <span class="o">-</span> <span class="n">M</span> <span class="o">/</span> <span class="n">reg</span>
<span class="n">logA</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">A</span> <span class="o">+</span> <span class="mf">1e-15</span><span class="p">)</span>
<span class="n">logA</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">A</span> <span class="o">+</span> <span class="mf">1e-16</span><span class="p">)</span>
<span class="n">log_KU</span><span class="p">,</span> <span class="n">G</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="mi">2</span><span class="p">,</span> <span class="o">*</span><span class="n">logA</span><span class="o">.</span><span class="n">shape</span><span class="p">),</span> <span class="n">type_as</span><span class="o">=</span><span class="n">A</span><span class="p">)</span>
<span class="n">err</span> <span class="o">=</span> <span class="mi">1</span>
<span class="k">for</span> <span class="n">ii</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">numItermax</span><span class="p">):</span>
Expand Down Expand Up @@ -804,7 +804,7 @@ <h1>Source code for ot.bregman._barycenter</h1><div class="highlight"><pre>
<span class="n">log</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;err&#39;</span><span class="p">:</span> <span class="p">[]}</span>

<span class="n">M</span> <span class="o">=</span> <span class="o">-</span> <span class="n">M</span> <span class="o">/</span> <span class="n">reg</span>
<span class="n">logA</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">A</span> <span class="o">+</span> <span class="mf">1e-15</span><span class="p">)</span>
<span class="n">logA</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">A</span> <span class="o">+</span> <span class="mf">1e-16</span><span class="p">)</span>
<span class="n">log_KU</span><span class="p">,</span> <span class="n">G</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="mi">2</span><span class="p">,</span> <span class="o">*</span><span class="n">logA</span><span class="o">.</span><span class="n">shape</span><span class="p">),</span> <span class="n">type_as</span><span class="o">=</span><span class="n">A</span><span class="p">)</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="n">dim</span><span class="p">,</span> <span class="n">type_as</span><span class="o">=</span><span class="n">A</span><span class="p">)</span>
<span class="n">err</span> <span class="o">=</span> <span class="mi">1</span>
Expand Down
Loading

0 comments on commit de84f49

Please sign in to comment.