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