def step_up(self, cable_activities):        
        """ Train the daisychain using the current cable_activities """
        self.num_cables = np.maximum(self.num_cables, cable_activities.size)
        # Pad the incoming cable_activities array out to its full size 
        cable_activities = tools.pad(cable_activities, 
                                     (self.max_num_cables, 0))
        # Update cable_activities, incorporating sensing dynamics
        self.pre = self.cable_activities.copy()
        self.cable_activities = cable_activities.copy()
        self.post = self.cable_activities.copy()
        chain_activities = self.pre * self.post.T
        self.count += chain_activities
        self.count -= 1 / (self.AGING_TIME_CONSTANT * self.count + 
                           tools.EPSILON)
        self.count = np.maximum(self.count, 0)
        update_rate_raw_post = (self.pre * ((1 - self.CHAIN_UPDATE_RATE) / 
                                            (self.pre_count + tools.EPSILON) + 
		                                    self.CHAIN_UPDATE_RATE)) 
        update_rate_post = np.minimum(0.5, update_rate_raw_post)
        self.pre_count += self.pre
        self.pre_count -= 1 / (self.AGING_TIME_CONSTANT * self.pre_count +
                               tools.EPSILON)
        self.pre_count = np.maximum(self.pre_count, 0)
        post_difference = np.abs(self.pre * self.post.T - 
                                 self.expected_cable_activities)
        self.expected_cable_activities += update_rate_post * (
                self.pre * self.post.T - self.expected_cable_activities)
        self.post_uncertainty += (post_difference - 
                                  self.post_uncertainty) * update_rate_post 
        # Reaction is the expected post, turned into a deliberation_vote
        self.reaction = tools.weighted_average(self.expected_cable_activities, 
                                               self.pre)
        # Surprise is the difference between the expected post and
        # the actual one
        surprise_weights = (self.pre / (self.post_uncertainty + tools.EPSILON)
                            + tools.EPSILON)
        self.surprise = tools.weighted_average(
                np.abs(self.post.T - self.expected_cable_activities),
                surprise_weights) 
        # Reshape chain activities into a single column
        return chain_activities.ravel()[:,np.newaxis]
dataset/ETHPy150Open matt2000/becca/core/daisychain.py/DaisyChain.step_up/original