Closed sachinsharma9780 closed 1 year ago
There are a lot of useful operators that take edge features into account, e.g., NNConv
, SplineConv
, GMMConv
. In addition, it shouldn't be hard to implement one by yourself, e.g.:
def message(self, x_i, x_j, edge_attr):
return self.lin(torch.cat([x_i, x_j, edge_attr], dim=-1)
ok, thnx for the suggestions.
Hi, I have created graphs and following is the info regarding one graph: Data(edge_attr=[261632], edge_index=[2, 261632], x=[512, 64], y=[1])
My question is: I am only able to perform training with batch_size=1, else it is giving CUDA out of memory error which is : Tried to allocate 3.99 GiB (GPU 0; 10.92 GiB total capacity; 4.51 GiB already allocated; 2.02 GiB free; 3.78 GiB cached) I dont know what is happening?
Total gpu mem is 11 gb.
mask.sum().item() / mask.size(0)
yields the split percentage.- The order is different. We first apply GCN and then select the specific nodes using the masks for loss/metric computation. This is a semi-supervised learning scenario where we make use of the whole graph structure but only make use of the ground-truth of a small amount of nodes.
so this semi supervised algo has one drawback that after training if new data point comes and we want to make prediction on it then do we need to train the whole graph again with new data point? Is that correct?
Generally, yes! However, your model might be able to generalize to some extent without re-training.
❓ Questions & Help
Hi I am using enzymes_topk_pool(ETP) algorithm for Medical Image classification. I have created features out of Images and converted them into data format accepted by pytorchg data loader. But after that when I try to give these features to the ETP algo , model is not able to learn anything. Training and test loss doesn't change from 1st epoch until the end. Everything remains constant. More info: Its binary classification problem. Below i am attaching the small script so that u get an idea.
class Net(torch.nn.Module): def init(self): super(Net, self).init()
41 = number of features
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model = Net().to(device) optimizer = torch.optim.Adam(model.parameters(), lr=0.001) scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, verbose=True)
crit = torch.nn.BCELoss() import pdb def train(epoch): model.train()
from sklearn.metrics import roc_auc_score def evaluate(loader): model.eval()
for epoch in range(1, 201): loss = train(epoch) train_auc = evaluate(train_loader) test_auc = evaluate(test_loader)
train_acc = test(train_loader)
Note: For feature extraction from Images I have used ur Master thesis code. I have just used Form_feature_extration file and adjacency.py file but not feature_selection and coarsening file. Are they also needed to create features? Because currently, I have 41 features for every node in the image.
Thanks in advance!