Hyperparameter tuning using Trainer not getting same performance
I am doing hyperparameter tuning as suggested in below linkHyperparameter Search using Trainer API (huggingface.co).After tuning, when I try to train the model with best parameters I am not getting the same performance.the best trial - Trial 2 finished with value: 0.8181818181818182 and parameters: {‘weight_decay’: 0.18182315978815689, ‘learning_rate’: 2.8534508921816434e-05, ‘warmup_steps’: 83}. Best is trial 2 with value: 0.8181818181818182.Training with best parameters -model = AutoModelForSequenceClassification.from_pretrained(“distilbert-base-uncased”, num_labels=2)training_args = TrainingArguments(output_dir=“test_trainer”, evaluation_strategy=“epoch”,num_train_epochs=1,per_device_train_batch_size=32,per_device_eval_batch_size=32,weight_decay=0.18182315978815689, learning_rate= 2.8534508921816434e-05, warmup_steps=83)trainer = CustomTrainer(#model=model,args=training_args,train_dataset=tokenized_train_dataset,eval_dataset=tokenized_test_dataset,compute_metrics=compute_metrics,model_init=model_init)trainer.train()image1542×184 6.75 KB