A flexible characterization methodology of RRAM : application to the modeling of the conductivity changes as synaptic weight updates