Artificial Synapse Based on Organic–Inorganic Hybrid Perovskite with Electric and Optical Modulation