diffalign.models.encoder package¶
Submodules¶
diffalign.models.encoder.edge module¶
- class diffalign.models.encoder.edge.MLPEdgeEncoder(hidden_dim=100, activation='relu')[source]¶
Bases:
Module- forward(edge_length, edge_type)[source]¶
- Input:
edge_length: The length of edges, shape=(E, 1). edge_type: The type pf edges, shape=(E,)
- Returns:
The representation of edges. (E, self.hidden_dim)
- Return type:
edge_attr
- property out_channels¶
diffalign.models.encoder.egnn module¶
- class diffalign.models.encoder.egnn.EGNN(in_node_nf: int, in_edge_nf: int, hidden_nf: int, device: str = 'cpu', act_fn=SiLU(), n_layers: int = 4, attention: bool = False, norm_diff: bool = True, out_node_nf: int | None = None, tanh: bool = False, coords_range: float = 15.0, agg: str = 'sum', norm_constant: float = 0.0)[source]¶
Bases:
Module- forward(h: Tensor, x: Tensor, edges: Tensor, edge_attr: Tensor | None = None, node_mask: Tensor | None = None, edge_mask: Tensor | None = None, coord_mask: Tensor | None = None, node_attr: Tensor | None = None)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class diffalign.models.encoder.egnn.E_GCL(input_nf: int, output_nf: int, hidden_nf: int, edges_in_d: int = 0, nodes_att_dim: int = 0, act_fn=SiLU(), attention: bool = False, norm_diff: bool = True, tanh: bool = False, coords_range: float = 1.0, norm_constant: float = 0.0)[source]¶
Bases:
Module- forward(h: Tensor, edge_index: Tensor, coord: Tensor, edge_attr: Tensor | None = None, node_attr: Tensor | None = None, node_mask: Tensor | None = None, edge_mask: Tensor | None = None, coord_mask: Tensor | None = None)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.