MI4 random reboots is solved here,
Download the weekly rom
Go to TWRP
Format, Cache, Davik, System, Data
Install new rom
Reboot
After that, setup your phone again and download all your apps again from playstore.
Your SDcard is not formatted so you will not lose all your photos.