Reconstructing Rocks with Machine Learning