Neural-network approach to modeling liquid crystals in complex confinement.