MCPcopy Create free account

hub / github.com/DrugLT/ImDrug / functions

Functions316 in github.com/DrugLT/ImDrug

Methodconvert_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
Functionconvert_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
Methodconvert_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
Functioncopy_model_params_from_to
(source, target)
lib/utils/pytorch.py:41
Functioncreate_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
Methoddefault
(self, model, criterion, data, label, meta, meta_data, meta_label, lds_weight=None, **kwargs)
lib/core/combiner.py:95
Functiondefault_collate_func
(batch, entity_type)
lib/dataset/base_dataset.py:40
Functiondgl_collate_func
(batch, entity_type)
lib/dataset/base_dataset.py:47
Methoddive
(self, model, criterion, data, label, meta, **kwargs)
lib/core/combiner.py:285
Functionfanin_init
(tensor)
lib/utils/pytorch.py:83
Methodforward
Update node representations. Parameters ---------- g : DGLGraph DGLGraph for a batch of graphs feats : Flo
lib/backbone/graph.py:67
Methodforward
(self, input)
lib/backbone/graph.py:189
Methodforward
(self, x)
lib/backbone/graph.py:240
Methodforward
Update node representations. Parameters ---------- g : DGLGraph DGLGraph for a batch of graphs node_feats
lib/backbone/graph.py:305
Methodforward
Update node representations Parameters ---------- g : DGLGraph DGLGraph for a batch of graphs categorical_
lib/backbone/graph.py:428
Methodforward
(self, v)
lib/backbone/sequence.py:28
Methodforward
(self, v)
lib/backbone/sequence.py:79
Methodforward
(self, v)
lib/backbone/sequence.py:163
Methodforward
(self, v)
lib/backbone/mlp.py:21
Methodforward
(self, v)
lib/head/classifier.py:18
Methodforward
(self, x)
lib/head/classifier.py:34
Methodforward
(self, x)
lib/head/classifier.py:48
Methodforward
(self, inputs, input_kws)
lib/neck/pooling_ops.py:15
Methodforward
(self, inputs, input_kws)
lib/neck/pooling_ops.py:24
Methodforward
(self, inputs:list, input_kws:list)
lib/neck/pooling_ops.py:31
Methodforward
Perform the forward pass.
lib/neck/activation.py:10
Methodforward
(self, x, **kwargs)
lib/net/network.py:47
Methodforward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_base.py:18
Methodforward
Args: inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) targets: ground truth labels wi
lib/loss/loss_base.py:40
Methodforward
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
Methodforward
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
Methodforward
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
Methodforward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/focal_R.py:18
Methodforward
(self, inputs_s, inputs_t, targets, **kwargs)
lib/loss/loss_impl/kld_loss.py:30
Methodforward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/balanced_mse_loss.py:16
Methodforward
(self, inputs, targets, lds_weight=None, **kwargs)
lib/loss/loss_impl/LDS.py:14
Methodforward
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
Methodforward
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
Methodforward
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
Methodforward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/focal_loss.py:16
Methodforward
(self, inputs, targets, **kwargs)
lib/loss/loss_impl/cross_entropy_label_aware_smooth_loss.py:43
Methodforward
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
Methodget_accuracy
(self)
lib/core/evaluate.py:376
Functionget_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
Methodget_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
Methodget_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
Methodget_config_class
(cls)
lib/config/argconfig.py:338
Methodget_instance
(cls, config: Config, args, params=None)
lib/config/argconfig.py:343
Functionget_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
Methodget_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
Methodget_lr
(self)
lib/utils/lr_scheduler.py:33
Functionget_metric
(x)
lib/utils/misc.py:121
Functionget_numpy
(tensor)
lib/utils/pytorch.py:115
Methodget_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
Methodget_pre_per_class
(self)
lib/core/evaluate.py:366
Functionget_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
Methodget_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
Methodget_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
Methodget_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
Functionget_task2category
()
lib/metadata.py:127
Functionglobal_seed
(seed)
lib/utils/pytorch.py:26
Functiongpu_enabled
()
lib/utils/pytorch.py:38
Methodharmonize_affinities
Removing duplicated drug-target pairs with different binding affinities.
lib/dataset/multi_pred/dti.py:51
Functioninit_weight
(m, initrange=0.1, zero_bias=False)
lib/utils/pytorch.py:71
Functioninitialize_weights
Initializes the weights of a model in place. :param model: An nn.Module.
lib/utils/pytorch.py:139
Functionlabel_dist
plot the distribution of label Args: y (list): a list of labels name (None, optional): dataset name
lib/utils/label.py:115
Methodlabel_distribution
visualize distribution of labels
lib/dataset/base_dataset.py:439
Methodload_backbone_model
(self, backbone_paths)
lib/net/network.py:111
Functionload_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
Methodmanifold_mix_up
r""" References: Verma et al., Manifold Mixup: Better Representations by Interpolating Hidden States, ICML 2019. Speciall
lib/core/combiner.py:163
Methodmix_up
r""" References: Zhang et al., mixup: Beyond Empirical Risk Minimization, ICLR
lib/core/combiner.py:134
Functionmpnn_collate_func
(batch, entity_type)
lib/dataset/base_dataset.py:60
Methodneg_sample
negative sampling Args: frac (int, optional): the ratio between negative and positive samples. Returns
lib/dataset/multi_pred/bi_pred_dataset.py:280
Functionnormal
(*args, **kwargs)
lib/utils/pytorch.py:136
Functionnp_to_pytorch_batch
(np_batch)
lib/utils/pytorch.py:61
Functionones
(*sizes, **kwargs)
lib/utils/pytorch.py:124
Functionpcc
(y_true, y_pred)
lib/core/evaluate.py:51
Functionprecision_at_recall_k
(y_true, y_pred, threshold = 0.9)
lib/core/evaluate.py:44
Methodprint_stats
print statistics
lib/dataset/base_dataset.py:403
Methodprint_stats
print the statistics of the dataset
lib/dataset/multi_pred/multi_pred_dataset.py:75
Methodprint_stats
print the statistics of the dataset
lib/dataset/multi_pred/bi_pred_dataset.py:126
Functionrandn
(*args, **kwargs)
lib/utils/pytorch.py:128
Functionrecall_at_precision_k
(y_true, y_pred, threshold = 0.9)
lib/core/evaluate.py:37
Methodremix
r""" Reference: Chou et al. Remix: Rebalanced Mixup, ECCV 2020 workshop. The difference between input mixup and remix is
lib/core/combiner.py:186
Methodreset
(self)
lib/core/combiner.py:414
Methodreset_parameters
Reinitialize model parameters.
lib/backbone/graph.py:59
Functionretrieve_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
Functionrmse
(y_true, y_pred)
lib/core/evaluate.py:34
Functionroc_auc
(y_true, y_pred, sample_weight=None, per_class=False)
lib/core/evaluate.py:54
Functionsave_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
Functionset_gpu_mode
(mode, gpu_id=0)
lib/utils/pytorch.py:16
Functionsoft_update_from_to
(source, target, tau)
lib/utils/pytorch.py:77
Methodto
(self, device)
lib/dataset/base_dataset.py:34
Methodto_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
Functionto_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
Functionuniprot2seq
Get protein sequence from Uniprot ID Args: ProteinID (str): the uniprot ID Returns: str: amino acid sequence
lib/utils/query.py:52
Methodupdate
(self, epoch)
lib/dataset/base_dataset.py:336
Methodupdate
Adopt cost-sensitive cross-entropy as the default Args: epoch: int. starting from 1.
lib/loss/loss_base.py:27
Methodupdate
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
Methodupdate
Args: epoch: int
lib/loss/loss_impl/balanced_softmax_cross_entropy_loss.py:36
← previousnext →201–300 of 316, ranked by callers