Rebuild spatial edges from masks while preventing cycles.
(
self,
temperature: float = 1.0,
threshold: float = None,
)
| 178 | self.nodes[node_id].add_successor(self.decision_node) |
| 179 | |
| 180 | def construct_spatial_connection( |
| 181 | self, |
| 182 | temperature: float = 1.0, |
| 183 | threshold: float = None, |
| 184 | ): |
| 185 | """Rebuild spatial edges from masks while preventing cycles.""" |
| 186 | self.clear_spatial_connection() |
| 187 | for potential_connection, edge_mask in zip(self.potential_spatial_edges, self.spatial_masks.view(-1)): |
| 188 | out_node:Node = self.find_node(potential_connection[0]) |
| 189 | in_node:Node = self.find_node(potential_connection[1]) |
| 190 | if edge_mask == 0.0: |
| 191 | continue |
| 192 | if not self.check_cycle(in_node, {out_node}): |
| 193 | out_node.add_successor(in_node,'spatial') |
| 194 | |
| 195 | def construct_temporal_connection( |
| 196 | self, |
no test coverage detected