Hyperparameter tuning in optuna

Currently, I am a student who is conducting experiments by applying deep learning and machine learning to my major field. I made an ann model with PyTorch and then applied it to the experiment, but there was a slight error, so I am leaving a writing.

  1. In the first case, after creating the PyTorch model, the hyperparameter was arbitrarily designated and applied to the test data after learning by applying kfold=5 during the learning process. And in the second case, when the hyperparameter variable was obtained through gridsearch cv and applied to the test data, the accuracy was lower. :cry:
    I wonder why it didn’t come out with similar accuracy.

  2. And for the Pytorch model, optuna, ray tune seem to be used a lot for hyperparameter tuning, so I wonder why you use this module.

If anyone knows anything about this, I’d appreciate it if you could leave a little explanation. :pray: