Is 2 an hyperparameter here? Where is the other variance hyperparameter that you multiply the Kernel matrix with? In my matlab code, I set log of these values to 0, which means I set them to 1 (both of them). You should set both code to same values.