1. A method of storing information in a memory, comprising: computing, for each synapse of a plurality of synapses in a neural network, an update of a weight of that synapse according to a learning rule; and switching, in probabilistic manner for each of the synapses, a binary state of a location within the memory associated with that synapse based on the update of weight.