Rock porosity prediction using multilayer predictions