Memristor-based neural networks: Synaptic versus neuronal stochasticity