modified calker_train_random_kernel to support rand num