You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mm_unbalanced(a, b, M, reg_m; reg=0, c=a*b', kwargs...)
521
+
522
+
Solve the unbalanced optimal transport problem and return the OT plan.
523
+
The function solves the following optimization problem:
524
+
525
+
```math
526
+
W = \\min_{\\gamma \\geq 0} \\langle \\gamma, M \\rangle_F +
527
+
\\mathrm{reg_{m1}} \\cdot \\operatorname{div}(\\gamma \\mathbf{1}, a) +
528
+
\\mathrm{reg_{m2}} \\cdot \\operatorname{div}(\\gamma^\\mathsf{T} \\mathbf{1}, b) +
529
+
\\mathrm{reg} \\cdot \\operatorname{div}(\\gamma, c)
530
+
```
531
+
532
+
where
533
+
534
+
- `M` is the metric cost matrix,
535
+
- `a` and `b` are source and target unbalanced distributions,
536
+
- `c` is a reference distribution for the regularization,
537
+
- `reg_m` is the marginal relaxation term (if it is a scalar or an indexable object of length 1, then the same term is applied to both marginal relaxations), and
538
+
- `reg` is a regularization term.
539
+
540
+
This function is a wrapper of the function
541
+
[`mm_unbalanced`](https://pythonot.github.io/gen_modules/ot.unbalanced.html#ot.unbalanced.mm_unbalanced) in the
542
+
Python Optimal Transport package. Keyword arguments are listed in the documentation of the
543
+
Python function.
544
+
545
+
# Examples
546
+
547
+
```jldoctest
548
+
julia> a=[.5, .5];
549
+
550
+
julia> b=[.5, .5];
551
+
552
+
julia> M=[1. 36.; 9. 4.];
553
+
554
+
julia> round.(mm_unbalanced(a, b, M, 5, div="kl"), digits=2)
555
+
2×2 Matrix{Float64}:
556
+
0.45 0.0
557
+
0.0 0.34
558
+
559
+
julia> round.(mm_unbalanced(a, b, M, 5, div="l2"), digits=2)
560
+
2×2 Matrix{Float64}:
561
+
0.4 0.0
562
+
0.0 0.1
563
+
```
564
+
565
+
"""
566
+
functionmm_unbalanced(a, b, M, reg_m; kwargs...)
567
+
return pot.unbalanced.mm_unbalanced(a, b, M, reg_m; kwargs...)
0 commit comments