Hyperparameter value while computing the test log-likelihood I have a very basic machine learning question.
My likelihood function includes a parameter $\alpha$ which I set to a fixed value and do not learn from the model, which makes it a "hyperparameter". And I intend to select the optimal value of this hyperparameter using a cross-validation test. Apparently, the value of my likelihood function depends on the value of $\alpha$. So, should I necessarily use the fixed value of $\alpha$ I used in training while computing the test fold log-likelihood?
First I thought that would be the case, but then I remembered that in penalized regression models, the penalty parameter is treated as the hyperparameter, and while computing the test error, we don't include the penalty term, but just the standard mean squared error. This makes sense but also caused me a confusion because such a computation of log-likelihood without including the value of the hyperparameter is not possible in my case.
Any suggestions are welcome!
 A: The loss function $f$ that is optimized to obtain the model parameters is not necessarily the loss function $g$ that is used in the cross-validation and used to determine the performance of the fitting procedure in the training and testing data (checking for over-/under-training etc.). 
Therefore when you use a hyperparameter in the optimization of $f$ it may not always occur as well in $g$. 
After training you may throw away the hyperparameters and only use the fitted coefficients as the model to make predictions with new test data (such as in lasso which is about finding coefficients and $\lambda$ is irrelevant and only fine-tuned to find good coefficients). 
I believe that, when your are optimizing hyperparameters, then it would not be great to have hyperparameters included in your loss function $g$ that is used to evaluate the performance (like using a weighted loss function $\alpha L_1 + (1-\alpha) L_2$ as you mentioned in comments). This means that you have no fixed idea about what loss function should be used to define good performance and your procedure will be adjusting your ideas about good performance according to your model, rather than adjusting your model according to your ideas about good performance.
