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

关于NR_IMAGE_PER EPOCH以及max_diff参数的设置 #235

Open
phjzlh opened this issue Jun 15, 2023 · 2 comments
Open

关于NR_IMAGE_PER EPOCH以及max_diff参数的设置 #235

phjzlh opened this issue Jun 15, 2023 · 2 comments

Comments

@phjzlh
Copy link

phjzlh commented Jun 15, 2023

作者你好,请问NR_IMAGE_PER EPOCH训练图像对的数量应该随数据集怎样取值?以及max_diff这个参数的具体意义是图像对的最大相对距离吗?但是以下实现的代码并不是此意思,是否代码有误?
def _sample_pair_idx_pair_within_max_diff(self, L, max_diff):
r"""
Draw a pair of index in range(L) within a given maximum difference
Arguments
---------
L: int
difference
max_diff: int
difference
"""
rng = self._state["rng"]
idx1 = rng.choice(L)
idx2_choices = list(range(idx1-max_diff, L)) +
list(range(L+1, idx1+max_diff+1))
idx2_choices = list(set(idx2_choices).intersection(set(range(L))))
idx2 = rng.choice(idx2_choices)
return int(idx1), int(idx2)

@MARMOTatZJU
Copy link
Contributor

数据集的图片数目越大,NR_IMAGE_PER_EPOCH 也应该适当增加。

max_diff 确实表示 idx1idx2 的最大距离。

@phjzlh
Copy link
Author

phjzlh commented Jun 19, 2023

数据集的图片数目越大,NR_IMAGE_PER_EPOCH 也应该适当增加。

max_diff 确实表示 idx1idx2 的最大距离。

感谢您的回答!

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

2 participants