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

[Question] Can we have 2 datasets in the TaskSampler (different for Query and Support dataset)? #148

Open
talhaashraf7213 opened this issue May 13, 2024 · 1 comment

Comments

@talhaashraf7213
Copy link

Problem
I am trying to implement something like this

test_sampler2 = CustomTaskSampler(
    support_dataset=support_dataset,
    query_dataset=query_dataset,
    n_way=N_WAY,
    n_shot=N_SHOT,
    n_query=N_QUERY,
    n_tasks=N_EVALUATION_TASKS,
)

where I can use my custom images dataset as the query dataset and CFAR100 as my support dataset.

I wanted to know from your experience if it's possible and secondly is it a good approach to improve accuracy of the model?

Considered solutions
I have tried to create a custom Class CustomTaskSampler and implement the __iter__ and episodic_collate_fn but maybe I am struggling with the implementation so I wanted to validate the approach.

would highly appreciate your input.

Thank you

@talhaashraf7213 talhaashraf7213 changed the title Can we have 2 datasets in the TaskSampler (different for Query and Support dataset)? [Question] Can we have 2 datasets in the TaskSampler (different for Query and Support dataset)? May 13, 2024
@ebennequin
Copy link
Collaborator

Hi! I've given your issue some thought and I don't see how it can be solved with just a custom sampler, because you are going to feed it to a DataLoader which only handles a single dataset.

I believe that you need to design:

  1. A custom dataset with defined items that can be sampled in support sets and others that can be sampled in query sets.
  2. A sampler modified from TaskSampler that samples support and query items from relevant subsets of the dataset.

I wanted to know from your experience if it's possible and secondly is it a good approach to improve accuracy of the model?

It's difficult to answer this as I don't know what you are trying to achieve with these experiments.

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