A bio-inspired mechano-photonic artificial synapse