Deep Learning for Optimal Phase-Shift and Beamforming Based on Individual and Cascaded Channels Estimation in the RIS-MIMO System