@@ -14,7 +14,7 @@ export sinkhorn, sinkhorn2
1414export emd, emd2
1515export sinkhorn_stabilized, sinkhorn_stabilized_epsscaling, sinkhorn_barycenter
1616export sinkhorn_unbalanced, sinkhorn_unbalanced2
17- export ot_reg_plan
17+ export ot_reg_plan, ot_reg_cost
1818
1919const MOI = MathOptInterface
2020
@@ -567,6 +567,25 @@ function ot_reg_plan(mu, nu, C, eps; reg_func="L2", method="lorenz", kwargs...)
567567 end
568568end
569569
570+ """
571+ ot_reg_cost(mu, nu, C, eps; reg_func = "L2", method = "lorenz", kwargs...)
572+
573+ Compute the optimal transport cost between `mu` and `nu` for optimal transport with a
574+ general choice of regulariser `math Ω(γ)`.
575+
576+ See also: [`ot_reg_plan`](@ref)
577+
578+ """
579+ function ot_reg_cost (mu, nu, C, eps; reg_func= " L2" , method= " lorenz" , kwargs... )
580+ γ = if (reg_func == " L2" ) && (method == " lorenz" )
581+ quadreg (mu, nu, C, eps; kwargs... )
582+ else
583+ @warn " Unimplemented"
584+ nothing
585+ end
586+ return dot (γ, C)
587+ end
588+
570589
571590"""
572591 quadreg(mu, nu, C, ϵ; θ = 0.1, tol = 1e-5,maxiter = 50,κ = 0.5,δ = 1e-5)
0 commit comments