How to use the deeprank.select_module.SelectNet function in deeprank

To help you get started, we’ve selected a few deeprank examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pl8787 / DeepRank_PyTorch / deeprank / select_module / group_pointer_net.py View on Github external
from collections import defaultdict

import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F

from deeprank import select_module


class GroupPointerNet(select_module.SelectNet):
    def __init__(self, config, out_device=None):
        super().__init__(config)
        self.output_type = 'LL'

        self.pad_value = self.config['pad_value']
        self.win_size = self.config['win_size']

        self.max_match = self.config['max_match']

        self.embedding = nn.Embedding(
            config['vocab_size'],
            config['embed_dim'],
            padding_idx=self.pad_value
        )

        self.embedding.weight.requires_grad = self.config['finetune_embed']
github pl8787 / DeepRank_PyTorch / deeprank / select_module / identity_net.py View on Github external
from collections import defaultdict

import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F

from deeprank import select_module


class IdentityNet(select_module.SelectNet):
    def __init__(self, config):
        super().__init__(config)

    def forward(self, q_data, d_data, q_len, d_len):
        q_data = q_data[:, :self.config['q_limit']]
        d_data = d_data[:, :self.config['d_limit']]
        q_len = torch.clamp(q_len, max=self.config['q_limit'])
        d_len = torch.clamp(d_len, max=self.config['d_limit'])
        return q_data, d_data, q_len, d_len
github pl8787 / DeepRank_PyTorch / deeprank / select_module / query_centric_net.py View on Github external
from collections import defaultdict
from itertools import chain

import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F

from deeprank import select_module


class QueryCentricNet(select_module.SelectNet):
    def __init__(self, config, out_device=None):
        super().__init__(config)
        self.output_type = 'LL'

        self.pad_value = self.config['pad_value']

        self.max_match = self.config['max_match']
        self.win_size = self.config['win_size']

        self.q_size = self.config['q_limit']
        self.d_size = self.max_match

        # key (doc_id, q_item)
        self.cache = {}
        self.out_device = out_device
github pl8787 / DeepRank_PyTorch / deeprank / select_module / pointer_net.py View on Github external
from collections import defaultdict

import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F

from deeprank import select_module


class PointerNet(select_module.SelectNet):
    def __init__(self, config, out_device=None):
        super().__init__(config)
        self.output_type = 'LL'

        self.pad_value = self.config['pad_value']
        self.win_size = self.config['win_size']

        self.max_match = self.config['max_match']

        self.embedding = nn.Embedding(
            config['vocab_size'],
            config['embed_dim'],
            padding_idx=self.pad_value
        )

        self.embedding.weight.requires_grad = self.config['finetune_embed']

deeprank

Rank Protein-Protein Interactions using Deep Learning

Apache-2.0
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages