Stochastic hybrid 3D matrix: learning and adaptation of electrical properties