def propagate(self):
     MotivationUnit.propagate(self)
     # For the fast WTA:
     # Only once (when inhibition_sum not set = -1) all the activations in the WTA net are summed.
     # From this sum the inhibition can be calculated for each individual unit.
     if (WTAUnitFast.inhibition_sum == -1):
         WTAUnitFast.inhibition_sum = 0
         WTAUnitFast.net_sum = 0
         for i in range(0, len(WTAUnitFast.wtaUnitList)):
             WTAUnitFast.inhibition_sum += WTAUnitFast.weight_other * WTAUnitFast.wtaUnitList[
                 i].output_value
     self.input_sum += WTAUnitFast.inhibition_sum + (
         1 - WTAUnitFast.weight_other) * self.output_value
     if (self.input_sum > 0):
         # net_sum is used to keep track of all activations in the network for the next
         # timestep - it is used for normalization in the applyOutput time step.
         WTAUnitFast.net_sum += self.input_sum
Example #2
0
 def propagate(self):
     MotivationUnit.propagate(self)
     if (self.output_value > self.activation_threshold):
         for item in self.__modulatedConnectedTo:
             #print("Modulate: ", item[0].name, " / ", item[0].output_value)
             item[1].addIncomingValue(item[0].output_value * item[2])