code: def learn(self, x):
          
          y = self.encode(x)
          self.update_statistics([y]) 
          self.update_weights([x],[y])
          return y
docs: Encodes an input array, and performs weight updates and updates to the activity 
          statistics according to the respective methods implemented below.