Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bca4dd7
add fgw dictionary learning feature
cedricvincentcuaz Dec 7, 2021
11f387b
add fgw dictionary learning feature
cedricvincentcuaz Dec 7, 2021
41f62f0
plot gromov wasserstein dictionary learning
cedricvincentcuaz Dec 8, 2021
3845cbd
Update __init__.py
cedricvincentcuaz Dec 8, 2021
5a17a0d
Merge branch 'master' into gw_dictionarylearning
rflamary Dec 9, 2021
819ee22
Merge branch 'master' into gw_dictionarylearning
rflamary Dec 9, 2021
8b79a42
fix pep8 errors exact E501 line too long
cedricvincentcuaz Dec 9, 2021
c7cb2f8
override my changes to init
cedricvincentcuaz Dec 9, 2021
6f69561
fix last pep8 issues
cedricvincentcuaz Dec 13, 2021
38cff36
Merge branch 'master' into gw_dictionarylearning
rflamary Dec 17, 2021
0cd178d
Merge branch 'master' into gw_dictionarylearning
rflamary Jan 21, 2022
d531dae
add unitary tests for (F)GW dictionary learning without using autodif…
cedricvincentcuaz Jan 31, 2022
003ffdd
Merge branch 'master' into gw_dictionarylearning
rflamary Feb 1, 2022
3224814
correct tests for (F)GW dictionary learning without using autodiff
cedricvincentcuaz Feb 1, 2022
0c6adc9
Merge branch 'gw_dictionarylearning' of https://github.com/cedricvinc…
cedricvincentcuaz Feb 1, 2022
83f1f46
correct tests for (F)GW dictionary learning without using autodiff
cedricvincentcuaz Feb 1, 2022
44fd22b
fix docs and notations
cedricvincentcuaz Feb 3, 2022
0f981a2
Merge branch 'master' into gw_dictionarylearning
rflamary Feb 3, 2022
2550631
answer to review: improve tests, docs, examples + make node weights o…
cedricvincentcuaz Feb 4, 2022
06146d7
Merge branch 'gw_dictionarylearning' of https://github.com/cedricvinc…
cedricvincentcuaz Feb 4, 2022
45b7667
fix pep8 and examples
cedricvincentcuaz Feb 4, 2022
0610ee3
improve docs + tests + thumbnail
cedricvincentcuaz Feb 10, 2022
afd4d4e
make example faster
cedricvincentcuaz Feb 10, 2022
9db794b
improve ex
cedricvincentcuaz Feb 10, 2022
278a1aa
update README.md
cedricvincentcuaz Feb 11, 2022
aecd04a
make GDL tests faster
cedricvincentcuaz Feb 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix last pep8 issues
  • Loading branch information
cedricvincentcuaz committed Dec 13, 2021
commit 6f695612fb78264f22bf64906f9236a4e6724e67
2 changes: 1 addition & 1 deletion ot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
'sinkhorn_unbalanced2', 'sliced_wasserstein_distance',
'gromov_wasserstein', 'gromov_wasserstein2', 'gromov_barycenters', 'fused_gromov_wasserstein', 'fused_gromov_wasserstein2',
'max_sliced_wasserstein_distance',
'smooth', 'stochastic', 'unbalanced', 'partial', 'regpath']
'smooth', 'stochastic', 'unbalanced', 'partial', 'regpath']
6 changes: 3 additions & 3 deletions ot/gromov.py
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ def gromov_wasserstein_linear_unmixing(C, Cdictionary, p, q, reg=0., tol_outer=1
T = p[:, None] * q[None, :]
D = len(Cdictionary)
w = unif(D)
Cembedded = np.sum(w[:, None, None]*Cdictionary, axis=0)
Cembedded = np.sum(w[:, None, None] * Cdictionary, axis=0)
const_q = q[:, None] * q[None, :]
# Trackers for BCD convergence
convergence_criterion = np.inf
Expand Down Expand Up @@ -2109,7 +2109,7 @@ def _cg_gromov_wasserstein_unmixing(C, Cdictionary, Cembedded, w, const_q, T, st
a -= reg * np.sum((x - w)**2)
b -= 2 * reg * np.sum(w * (x - w))
if a > 0:
gamma = min(1, max(0, -b/(2 * a)))
gamma = min(1, max(0, - b / (2 * a)))
elif a + b < 0:
gamma = 1
else:
Expand Down Expand Up @@ -2277,7 +2277,7 @@ def fused_gromov_wasserstein_dictionary_learning(Cs, Ys, ps, D, nt, q, alpha, ep
shared_term_structures = Cs_embedded[batch_idx] * const_q - (Cs[C_idx].dot(Ts[batch_idx])).T.dot(Ts[batch_idx])
shared_term_features = diag_q.dot(Ys_embedded[batch_idx]) - Ts[batch_idx].T.dot(Ys[C_idx])
grad_Cdictionary += alpha * unmixings[batch_idx][:, None, None] * shared_term_structures[None, :, :]
grad_Ydictionary += (1 - alpha) * unmixings[batch_idx][:, None, None]*shared_term_features[None, :, :]
grad_Ydictionary += (1 - alpha) * unmixings[batch_idx][:, None, None] * shared_term_features[None, :, :]
grad_Cdictionary *= 2 / batch_size
grad_Ydictionary *= 2 / batch_size

Expand Down