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

What is the appropriate hyperparameter of MeanTeacherReg / ICTReg / PiModelReg when using other dataset? #8

Open
jason2133 opened this issue Jun 9, 2023 · 0 comments

Comments

@jason2133
Copy link

jason2133 commented Jun 9, 2023

Hi, Thanks for creating this library.
I am trying to use MeanTeacherReg, ICTReg, and PiModelReg with my custom dataset.
When I used MeanTeacherReg, ICTReg, and PiModelReg without changing the hyperparameter at the example code that was fitted to Boston Dataset, although the model works, the predictions all come to zero.
This means that the model did not learn my custom dataset properly.

What is the appropriate hyperparameter of MeanTeacherReg / ICTReg / PiModelReg when using other dataset?

I thought there are some hyperparemeters to change when using other dataset such as:

  1. num_samples
# sampler
labeled_sampler=RandomSampler(replacement=True,num_samples=64*(2**20))
unlabeled_sampler=RandomSampler(replacement=True)
valid_sampler=SequentialSampler()
test_sampler=SequentialSampler()
  1. batch_size
#dataloader
labeled_dataloader=LabeledDataLoader(batch_size=64,num_workers=0,drop_last=True)
unlabeled_dataloader=UnlabeledDataLoader(num_workers=0,drop_last=True)
valid_dataloader=UnlabeledDataLoader(batch_size=64,num_workers=0,drop_last=False)
test_dataloader=UnlabeledDataLoader(batch_size=64,num_workers=0,drop_last=False)
  1. epoch / num_it_epoch / num_it_total / eval_it
model=MeanTeacherReg(lambda_u=0,warmup=0.4,
               mu=1,weight_decay=5e-4,ema_decay=0.999,
               epoch=1,num_it_epoch=4000,
               num_it_total=4000,
               eval_it=200,device='cpu',
               labeled_dataset=labeled_dataset,
               unlabeled_dataset=unlabeled_dataset,
               valid_dataset=valid_dataset,
               test_dataset=test_dataset,
               labeled_sampler=labeled_sampler,
               unlabeled_sampler=unlabeled_sampler,
               valid_sampler=valid_sampler,
               test_sampler=test_sampler,
               labeled_dataloader=labeled_dataloader,
               unlabeled_dataloader=unlabeled_dataloader,
               valid_dataloader=valid_dataloader,
               test_dataloader=test_dataloader,
               augmentation=augmentation,network=network,
               optimizer=optimizer,scheduler=scheduler,
               evaluation=evaluation,file=file,verbose=True)

The size of my custom dataset,

  • labeled_X is (8760, 10),
  • labeled_y is (8760, 1),
  • Unlabeled_X is (8760, 10),
  • Unlabeled_y is (8760, 1)
  • Test_X is (8760, 10)
  • Test_y is (8760, 1).

At this setting, the model did not train my dataset properly.

Can you provide some example code that you worked the model using a different dataset, not Boston dataset?
Or, is there any tip to implement hyperparameter tuning of MeanTeacherReg, ICTReg, and Pi Model Reg?

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