def get_semi_activated_node(self): """returns the node with the 2nd highest activation """ activations = [] for i in self.nodes: activations.append(i.activation) return self.nodes[auks.posSemiMax(activations)]
def get_v_tag(self, h_tag, inaccuracy=None): """ retrieves the v_tag with the highest association for the given h_tag if there are more than one v_tags with the highest association value, the first one will be returned if inaccuracy == True/1, the v_tag with the 2nd highest association is returned """ h_index = -1 for count, i in enumerate(self.horizontal_tags): if i == h_tag: h_index = count break if h_index == -1: return "tag_unknown" else: value_list = [] for i in self.matrix: for count, j in enumerate(i): if count == h_index: value_list.append(j) if inaccuracy: return self.vertical_tags[auks.posSemiMax(value_list)] else: return self.vertical_tags[auks.posMax(value_list)]