code: def adapt(self, d, x):
          
          y = np.dot(self.w, x)
          e = d - y
          R1 = np.dot(np.dot(np.dot(self.R,x),x.T),self.R)
          R2 = self.mu + np.dot(np.dot(x,self.R),x.T)
          self.R = 1/self.mu * (self.R - R1/R2)
          dw = np.dot(self.R, x.T) * e
          self.w += dw
docs: Adapt weights according one desired value and its input.
  
          **Args:**
  
          * `d` : desired value (float)
  
          * `x` : input array (1-dimensional array)