Rebuild temporal edges for non-zero rounds from masks while preventing cycles.
(
self,
round:int = 0,
temperature: float = 1.0,
threshold: float = None,
)
| 193 | out_node.add_successor(in_node,'spatial') |
| 194 | |
| 195 | def construct_temporal_connection( |
| 196 | self, |
| 197 | round:int = 0, |
| 198 | temperature: float = 1.0, |
| 199 | threshold: float = None, |
| 200 | ): |
| 201 | """Rebuild temporal edges for non-zero rounds from masks while preventing cycles.""" |
| 202 | self.clear_temporal_connection() |
| 203 | if round == 0: |
| 204 | return |
| 205 | for potential_connection, edge_mask in zip(self.potential_temporal_edges, self.temporal_masks.view(-1)): |
| 206 | out_node:Node = self.find_node(potential_connection[0]) |
| 207 | in_node:Node = self.find_node(potential_connection[1]) |
| 208 | if edge_mask == 0.0: |
| 209 | continue |
| 210 | if not self.check_cycle(in_node, {out_node}): |
| 211 | out_node.add_successor(in_node,'temporal') |
| 212 | |
| 213 | def run( |
| 214 | self, |
no test coverage detected