Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions regarding using the "exact" method and default "gaussian_approx" method #24

Open
chenmzh opened this issue Mar 12, 2022 · 0 comments

Comments

@chenmzh
Copy link

chenmzh commented Mar 12, 2022

Dear auther,

I am trying to calculate the distance between the same dataset(USPS training dataset). According to the paper, it says $d_{OT-N} \le d_{OT}$. So I use the exact and default gaussian_approx method to compute the distance. However, the result gets from the gaussian approx is a little bit larger than the exact method which is almost 0 in this case, which seems different from the previous statement.

Here is the setting for two experiment:

# For d_OT
from otdd.pytorch.datasets import load_torchvision_data
from otdd.pytorch.distance import DatasetDistance


# Load datasets
loaders_src = load_torchvision_data('USPS', valid_size=0, resize = 28, maxsize=20000)[0]
loaders_tgt = load_torchvision_data('USPS',  valid_size=0, resize = 28, maxsize=20000)[0]

# Instantiate distance
dist = DatasetDistance(loaders_src['train'], loaders_tgt['train'],
                       inner_ot_method='exact',
                       inner_ot_debiased=True,
                       device='cpu')

d = dist.distance(maxsamples = 20000)
print(f'OTDD(src,tgt)={d}')

# For d_OT_N

# Instantiate distance
dist = DatasetDistance(loaders_src['train'], loaders_tgt['train'],
                       inner_ot_debiased=True,
                       device='cpu')

d = dist.distance(maxsamples = 20000)
print(f'OTDD(src,tgt)={d}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant