This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🏂 63km ████████████▊░░░░░░░ | |
🚶♂️ 21km ████▏░░░░░░░░░░░░░░░ | |
🏃♂️ 12km ██▍░░░░░░░░░░░░░░░░░ | |
🥾 2km ▏░░░░░░░░░░░░░░░░░░░ | |
🧗 0km ░░░░░░░░░░░░░░░░░░░░ | |
🕺🏻 0km ░░░░░░░░░░░░░░░░░░░░ | |
🚴♂️ 0km ░░░░░░░░░░░░░░░░░░░░ | |
🤸🏻 0km ░░░░░░░░░░░░░░░░░░░░ | |
96km total |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict, Tuple, Optional, Union, List | |
from torch_geometric.data import HeteroData | |
from torch_sparse import SparseTensor | |
from dgl.heterograph import DGLBlock, DGLHeteroGraph | |
from dgl._deprecate.graph import DGLGraph | |
from argparse import Namespace | |
from collections import OrderedDict | |
from collections.abc import MutableMapping | |
import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### Data Loaders ############# | |
def collate_fn(batch): | |
protein_seqs_all, physical, genetic, correlation, y_all, idx_all = [], [], [] ,[], [], [] | |
for X, y, idx in batch: | |
protein_seqs_all.append(torch.tensor(X["Protein_seqs"])) | |
physical.append(torch.tensor(X["Protein-Protein-physical"])) | |
genetic.append(torch.tensor(X["Protein-Protein-genetic"])) | |
correlation.append(torch.tensor(X["Protein-Protein-correlation"])) | |
y_all.append(torch.tensor(y)) | |
idx_all.append(torch.tensor(idx)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OnlineTripletLoss(tf.keras.layers.Layer): | |
def __init__(self, directed_margin=0.2, undirected_margin=0.1, undirected_weight=1.0, **kwargs): | |
super(OnlineTripletLoss, self).__init__(**kwargs) | |
self.output_dim = () | |
self.directed_margin = directed_margin | |
self.undirected_margin = undirected_margin | |
self.undirected_weight = undirected_weight | |
def build(self, input_shape): | |
assert isinstance(input_shape, list) |