bowang-lab / BIONIC

Biological Network Integration using Convolutions
MIT License
58 stars 4 forks source link

AttributeError: 'Data' object has no attribute 'weight' #6

Closed mr-september closed 3 years ago

mr-september commented 3 years ago

Getting this error on the CPU wheel

My config.json:

{
  "names": [
    "/media/september/Python/Outputs/PGCNA/PGCNA/EPG3/CORR_MATRIX_GMF0/TSVConverted/EdgeLists/CoEx_DEa_cluster_0_EdgeList.txt",
    "/media/september/Python/Outputs/PGCNA/PGCNA/EPG3/CORR_MATRIX_GMF0/TSVConverted/EdgeLists/CoEx_DEg_cluster_0_EdgeList.txt",
    "/media/september/Python/Outputs/PGCNA/PGCNA/EPG3/CORR_MATRIX_GMF0/TSVConverted/EdgeLists/CoEx_DV_cluster_0_EdgeList.txt"
  ],
  "out_name": "/media/september
[CoEx_DEa_cluster_0_EdgeList.txt](https://github.com/bowang-lab/BIONIC/files/6210267/CoEx_DEa_cluster_0_EdgeList.txt)

/Python/Outputs/BIONIC/CoEx_Cluster_0_BIONIC.txt",
  "epochs": 3000,
  "batch_size": 1024,
  "learning_rate": 0.0005,
  "gat_shapes": {
    "dimension": 64,
    "n_heads": 10,
    "n_layers": 2
  },
  "embedding_size": 512,
  "save_model": false
}

And attached 2/3 of my edgelists, the other one is too large (~300mb), but formatted identically.

CoEx_DEa_cluster_0_EdgeList.txt CoEx_DV_cluster_0_EdgeList.txt

Can you tell where I'm making mistakes?

duncster94 commented 3 years ago

You should specify that your networks are tab delimited with the field "delimiter": "\t", see here.

Two other things:

  1. I noticed you have negative edge weights in your networks. BIONIC assumes positive edge weights. If it makes sense for your application, I would remove negative edges, since these will very likely result in the model diverging.
  2. You said your third edgelist is 300mb. This is very large, and will be incredibly slow on the CPU implementation. If you can, you should sparsify this network as much as possible (i.e. only retain the top 95-99 percentile edgeweights, or something like that). See here.