pytorch_tabular icon indicating copy to clipboard operation
pytorch_tabular copied to clipboard

The architecture of TabularModelTuner best_model does not match best_params

Open kaboroevich opened this issue 1 year ago • 0 comments

Describe the bug The model in pytorch_tabular.tabular_model_tuner.OUTPUT.best_model is not the model defined by pytorch_tabular.tabular_model_tuner.OUTPUT.best_params but instead the model defined by the hyperparameter placeholders when constructing the various configs.

To Reproduce

  1. Follow How-To-Guide for Hyperparameter Turning
  2. Replace the search space with the placeholder parameters removed
search_space = {  
    "model_config__layers": ["1024-512-256", "1024-512-128"],  
    "model_config.head_config__dropout": [0.2, 0.3],  
     "trainer_config__batch_size": [1024, 2048, 4096],  
     "optimizer_config__optimizer": ["RAdam", "AdamW"],  
} 
  1. The output of the tune method will report the best parameters from the search_space, but the best model will have the parameters defined in CategoryEmbeddingModelConfig()

Expected behavior That the architecture of .best_model matches .best_params

Screenshots image

Additional context pytorch_tabular.version = '1.1.0'

kaboroevich avatar Apr 18 '24 03:04 kaboroevich