Synapses are critical components of an artificial neural network. Bacteriorhodopsin thin film can be used to construct compact, finely graded synapses for an optoelectronic neural network, based on its photochromic properties. Measurements show that these photochromic changes are blocked at low temperature. Thermal gating will allow synapses to be written on the film optically and then read without erasure by the same light and also will permit local implementation of an associative learning rule for updating synaptic weights.