Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DrugLT/ImDrug
/ functions
Functions
316 in github.com/DrugLT/ImDrug
⨍
Functions
316
◇
Types & classes
64
Method
convert_from_log
convert labels from log-scale Args: form (str, optional): standard log-transformation or binding nM <-> p transformation.
lib/dataset/base_dataset.py:498
Function
convert_to_log
log conversion helper Args: y (list): a list of labels Returns: np.array: an array of log-transformed labels
lib/utils/label.py:69
Method
convert_to_log
convert labels to log-scale Args: form (str, optional): standard log-transformation or binding nM <-> p transformation.
lib/dataset/base_dataset.py:485
Function
copy_model_params_from_to
(source, target)
lib/utils/pytorch.py:41
Function
create_group_split
split within each stratification defined by the group column for training/validation split Args: train_val (pd.DataFrame): the train+valid dat
lib/utils/split.py:819
Method
default
(self, model, criterion, data, label, meta, meta_data, meta_label, lds_weight=None, **kwargs)
lib/core/combiner.py:95
Function
default_collate_func
(batch, entity_type)
lib/dataset/base_dataset.py:40
Function
dgl_collate_func
(batch, entity_type)
lib/dataset/base_dataset.py:47
Method
dive
(self, model, criterion, data, label, meta, **kwargs)
lib/core/combiner.py:285
Function
fanin_init
(tensor)
lib/utils/pytorch.py:83
Method
forward
Update node representations. Parameters ---------- g : DGLGraph DGLGraph for a batch of graphs feats : Flo
lib/backbone/graph.py:67
Method
forward
(self, input)
lib/backbone/graph.py:189
Method
forward
(self, x)
lib/backbone/graph.py:240
Method
forward
Update node representations. Parameters ---------- g : DGLGraph DGLGraph for a batch of graphs node_feats
lib/backbone/graph.py:305
Method
forward
Update node representations Parameters ---------- g : DGLGraph DGLGraph for a batch of graphs categorical_
lib/backbone/graph.py:428
Method
forward
(self, v)
lib/backbone/sequence.py:28
Method
forward
(self, v)
lib/backbone/sequence.py:79
Method
forward
(self, v)
lib/backbone/sequence.py:163
Method
forward
(self, v)
lib/backbone/mlp.py:21
Method
forward
(self, v)
lib/head/classifier.py:18
Method
forward
(self, x)
lib/head/classifier.py:34
Method
forward
(self, x)
lib/head/classifier.py:48
Method
forward
(self, inputs, input_kws)
lib/neck/pooling_ops.py:15
Method
forward
(self, inputs, input_kws)
lib/neck/pooling_ops.py:24
Method
forward
(self, inputs:list, input_kws:list)
lib/neck/pooling_ops.py:31
Method
forward
Perform the forward pass.
lib/neck/activation.py:10
Method
forward
(self, x, **kwargs)
lib/net/network.py:47
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_base.py:18
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_base.py:40
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/ldam_loss.py:51
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/balanced_softmax_cross_entropy_loss.py:26
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/class_dependent_temperatures_loss.py:24
Method
forward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/focal_R.py:18
Method
forward
(self, inputs_s, inputs_t, targets, **kwargs)
lib/loss/loss_impl/kld_loss.py:30
Method
forward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/balanced_mse_loss.py:16
Method
forward
(self, inputs, targets, lds_weight=None, **kwargs)
lib/loss/loss_impl/LDS.py:14
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/equalization_loss.py:35
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/class_balanced_loss.py:67
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/cross_entropy_label_smooth_loss.py:22
Method
forward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/focal_loss.py:16
Method
forward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/cross_entropy_label_aware_smooth_loss.py:43
Method
forward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_impl/influence_balanced_loss.py:22
Method
get_accuracy
(self)
lib/core/evaluate.py:376
Function
get_activation_function
Gets an activation function module given the name of the activation. :param activation: The name of the activation function. #TODO: the type
lib/head/utils.py:8
Method
get_config
Get the args and kwargs for corresponding class. Need to be override by child class Should be written by designer and used by user
lib/config/argconfig.py:65
Method
get_config
Get the config from args. :param args: the input arguments. :param params: the necessary parameters to initialize target clas
lib/config/argconfig.py:283
Method
get_config_class
(cls)
lib/config/argconfig.py:338
Method
get_instance
(cls, config: Config, args, params=None)
lib/config/argconfig.py:343
Function
get_label_map
to retrieve the biomedical meaning of labels Args: name (str): the name of the dataset path (str, optional): the dataset path, where the
lib/utils/retrieve.py:11
Method
get_label_meaning
get the biomedical meaning of label Args: output_format (str, optional): dict/df/array for label Returns
lib/dataset/base_dataset.py:510
Method
get_lr
(self)
lib/utils/lr_scheduler.py:33
Function
get_metric
(x)
lib/utils/misc.py:121
Function
get_numpy
(tensor)
lib/utils/pytorch.py:115
Method
get_parser
The function to generate parser. Need to be override by child class. Should be written by designer and used by user :param pa
lib/config/argconfig.py:49
Method
get_pre_per_class
(self)
lib/core/evaluate.py:366
Function
get_reaction_type
to retrieve the type of reactions for reaction dataset Args: name (str): dataset name path (str, optional): dataset path output_form
lib/utils/retrieve.py:43
Method
get_split
split dataset into train/validation/test. Args: method (str, optional): split method, the default value is 'ran
lib/dataset/multi_pred/multi_pred_dataset.py:82
Method
get_split
split dataset into train/validation/test. Args: method (str, optional): split method, the default value is 'rand
lib/dataset/multi_pred/bi_pred_dataset.py:149
Method
get_split
Arguments: method: splitting schemes, choose from random, cold_{entity}, scaffold, defaults to 'random' seed: the random seed for splitting d
lib/dataset/single_pred/single_pred_dataset.py:111
Function
get_task2category
()
lib/metadata.py:127
Function
global_seed
(seed)
lib/utils/pytorch.py:26
Function
gpu_enabled
()
lib/utils/pytorch.py:38
Method
harmonize_affinities
Removing duplicated drug-target pairs with different binding affinities.
lib/dataset/multi_pred/dti.py:51
Function
init_weight
(m, initrange=0.1, zero_bias=False)
lib/utils/pytorch.py:71
Function
initialize_weights
Initializes the weights of a model in place. :param model: An nn.Module.
lib/utils/pytorch.py:139
Function
label_dist
plot the distribution of label Args: y (list): a list of labels name (None, optional): dataset name
lib/utils/label.py:115
Method
label_distribution
visualize distribution of labels
lib/dataset/base_dataset.py:439
Method
load_backbone_model
(self, backbone_paths)
lib/net/network.py:111
Function
load_dict
load an object from a path Args: path (str): the path where the pickle file locates Returns: object: loaded pickle file
lib/utils/misc.py:82
Method
manifold_mix_up
r""" References: Verma et al., Manifold Mixup: Better Representations by Interpolating Hidden States, ICML 2019. Speciall
lib/core/combiner.py:163
Method
mix_up
r""" References: Zhang et al., mixup: Beyond Empirical Risk Minimization, ICLR
lib/core/combiner.py:134
Function
mpnn_collate_func
(batch, entity_type)
lib/dataset/base_dataset.py:60
Method
neg_sample
negative sampling Args: frac (int, optional): the ratio between negative and positive samples. Returns
lib/dataset/multi_pred/bi_pred_dataset.py:280
Function
normal
(*args, **kwargs)
lib/utils/pytorch.py:136
Function
np_to_pytorch_batch
(np_batch)
lib/utils/pytorch.py:61
Function
ones
(*sizes, **kwargs)
lib/utils/pytorch.py:124
Function
pcc
(y_true, y_pred)
lib/core/evaluate.py:51
Function
precision_at_recall_k
(y_true, y_pred, threshold = 0.9)
lib/core/evaluate.py:44
Method
print_stats
print statistics
lib/dataset/base_dataset.py:403
Method
print_stats
print the statistics of the dataset
lib/dataset/multi_pred/multi_pred_dataset.py:75
Method
print_stats
print the statistics of the dataset
lib/dataset/multi_pred/bi_pred_dataset.py:126
Function
randn
(*args, **kwargs)
lib/utils/pytorch.py:128
Function
recall_at_precision_k
(y_true, y_pred, threshold = 0.9)
lib/core/evaluate.py:37
Method
remix
r""" Reference: Chou et al. Remix: Rebalanced Mixup, ECCV 2020 workshop. The difference between input mixup and remix is
lib/core/combiner.py:186
Method
reset
(self)
lib/core/combiner.py:414
Method
reset_parameters
Reinitialize model parameters.
lib/backbone/graph.py:59
Function
retrieve_dataset_names
to get all available dataset names given a task Args: name (str): the name of query task Returns: list: a list of available datasets
lib/utils/retrieve.py:79
Function
rmse
(y_true, y_pred)
lib/core/evaluate.py:34
Function
roc_auc
(y_true, y_pred, sample_weight=None, per_class=False)
lib/core/evaluate.py:54
Function
save_dict
save an object to a pickle file Args: path (str): the path to save the pickle file obj (object): any file
lib/utils/misc.py:72
Function
set_gpu_mode
(mode, gpu_id=0)
lib/utils/pytorch.py:16
Function
soft_update_from_to
(source, target, tau)
lib/utils/pytorch.py:77
Method
to
(self, device)
lib/dataset/base_dataset.py:34
Method
to_graph
Summary TODO Args: threshold (float, optional): threshold to binarize the data. format (str, optional): form
lib/dataset/multi_pred/bi_pred_dataset.py:302
Function
to_submission_format
convert the results to submission-ready format in leaderboard Args: results (dict): a dictionary of metrics across five runs Returns:
lib/utils/misc.py:111
Function
uniprot2seq
Get protein sequence from Uniprot ID Args: ProteinID (str): the uniprot ID Returns: str: amino acid sequence
lib/utils/query.py:52
Method
update
(self, epoch)
lib/dataset/base_dataset.py:336
Method
update
Adopt cost-sensitive cross-entropy as the default Args: epoch: int. starting from 1.
lib/loss/loss_base.py:27
Method
update
Adopt the class-balanced loss as default re-weighting method in drw according to LDAM official codes. Args: epoch: int
lib/loss/loss_impl/ldam_loss.py:40
Method
update
Args: epoch: int
lib/loss/loss_impl/balanced_softmax_cross_entropy_loss.py:36
← previous
next →
201–300 of 316, ranked by callers