1. An artificial neural network, comprising a least one processing unit, each processing unit comprising (a) at least one artificial neuronal encoder for encoding a vector that is input to said encoder into a neuronal code that is output from said encoder and has an orthogonality property; (b) a plurality of artificial synapses each for storing an entry of a code deviation accumulation vector and for evaluating a first product of said entry and a component of a code deviation vector that is the deviation of a neuronal code from an average neuronal code; (c) a plurality of artificial synapses each for storing an entry of a code covariance matrix and for evaluating a second product of said entry and a component of a code deviation vector that is the deviation of a neuronal code from an average neuronal code; (d) an artificial nonspiking neuron for evaluating a first sum of products each of a first product and a masking factor; and (e) at least one artificial spiking neuron for evaluating at least one second sum of products each of a second product and a masking factor, for using said first sum and said at least one second sum to evaluate a representation of a first subjective probability distribution of a label of a vector that is input to said processing unit, and for generating at least one pseudorandom number in accordance with said first subjective probability distribution, wherein masking factors are diagonal entries of a masking matrix; said products each of a first product and a masking factor are entries of the product of a code deviation accumulation vector, a masking matrix and a code deviation vector; and said products each of a second product and a masking factor are entries of the product of a code covariance matrix, a masking matrix and a code deviation vector.