Model Module
FineTunerGNN
Bases: Module
The main Graph Neural Network model for structural refinement.
It consists of several GNN layers followed by an output head that predicts delta dihedrals for each residue.
Source code in torsiontuner/model.py
__call__(x, adj, edge_features)
Predict structural adjustments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
Input node features (one-hot residue types). |
required |
adj
|
ndarray
|
Adjacency matrix (sequential + spatial). |
required |
edge_features
|
ndarray
|
Edge features (normalized distances). |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Predicted delta dihedrals (delta_phi, delta_psi) for each residue. |
Source code in torsiontuner/model.py
GNNLayer
Bases: Module
A single Graph Neural Network layer that processes node and edge features.
This layer uses message passing to update node representations by aggregating information from neighbors, weighted by edge features (e.g., distances).
Source code in torsiontuner/model.py
__call__(x, adj, edge_features)
Forward pass of the GNN layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
Node features of shape (n_nodes, node_dim). |
required |
adj
|
ndarray
|
Adjacency matrix of shape (n_nodes, n_nodes). |
required |
edge_features
|
ndarray
|
Edge features of shape (n_nodes, n_nodes, 1). |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Updated node features of shape (n_nodes, out_dim). |