Hi. Head shaking maybe due to irritability due to some reason. Baby maybe hungry or sweaty or maybe has some pain or maybe due to excessive light which is causing baby not sleep. So these are a few reasons. Unless you have noticed anything else I dont see it as a reason to be worried about.
Next Steps
If this keeps happening, please visit your nearest Pediatrician.