MCPcopy Create free account

hub / github.com/Docta-ai/docta / functions

Functions186 in github.com/Docta-ai/docta

↓ 10 callersMethodfromfile
(filename, use_predefined_variables=True, import_custom_modules=True)
docta/utils/config.py:390
↓ 9 callersFunction_resnet
(arch, block, layers, pretrained, progress, **kwargs)
docta/models/backbones/resnet.py:217
↓ 8 callersMethod__setattr__
(self, name, value)
docta/utils/config.py:579
↓ 6 callersMethodupdate
(self, **kwargs)
docta/core/report.py:31
↓ 5 callersMethodencode_feature
(self)
docta/core/preprocess.py:126
↓ 5 callersFunctionload_embedding
(idx_list: list, data_path: Callable[[int], str], duplicate = True)
docta/datasets/data_utils.py:132
↓ 4 callersMethod__init__
If model is None: use pretrained models. Otherwise, use the provided models.
docta/apis/detect.py:10
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
docta/models/backbones/resnet_lowres.py:82
↓ 4 callersMethod_make_layer
(self, block, planes, blocks, stride=1, dilate=False)
docta/models/backbones/resnet.py:171
↓ 3 callersMethod__init__
(self, cfg, train=True, preprocess=None, noisy_label_key=None, clean_label_key=None)
docta/datasets/cifar.py:85
↓ 3 callersFunctionaccuracy
Calculate accuracy according to the prediction and target. Args: pred (torch.Tensor): The model prediction, shape (N, num_class)
docta/models/loss_funcs/accuracy.py:4
↓ 3 callersFunctionbuild_dataloader
(cfg_loader, dataset)
docta/core/preprocess.py:14
↓ 3 callersFunctionconv1x1
1x1 convolution
docta/models/backbones/resnet.py:28
↓ 3 callersFunctionconv3x3
3x3 convolution with padding
docta/models/backbones/resnet.py:22
↓ 3 callersMethoddetect
(self)
docta/apis/detect.py:20
↓ 3 callersFunctionget_consensus_patterns
KNN estimation
docta/core/hoc.py:151
↓ 3 callersFunctionlt_score
Input: data the extracted embedding / features from the given dataset; {array-like, sparse matrix} of shape (n_samples, n_
docta/core/get_lr_score.py:13
↓ 3 callersMethodsplit_string_by_keywords
(self, input_str, keywords)
docta/datasets/hh_rlhf.py:91
↓ 3 callersFunctionweight_reduce_loss
Apply element-wise weight and reduce loss. Args: loss (Tensor): Element-wise loss. weight (Tensor): Element-wise weights.
docta/models/loss_funcs/loss_utils.py:75
↓ 2 callersMethod__init__
(self, block, num_blocks, num_classes=10)
docta/models/backbones/resnet_lowres.py:70
↓ 2 callersMethod__init__
(self, block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=6
docta/models/backbones/resnet.py:120
↓ 2 callersMethod_merge_a_into_b
merge dict ``a`` into dict ``b`` (non-inplace). Values in ``a`` will overwrite ``b``. ``b`` is copied first to avoid in-place modific
docta/utils/config.py:333
↓ 2 callersFunctioncreate_markov_matrix
(weights_matrix)
docta/utils/LexRank.py:81
↓ 2 callersMethodhoc
(self)
docta/apis/diagnose.py:20
↓ 2 callersFunctionsave_extracted_dataset
(cfg, dataset_embedding, dataset_label, dataset_idx, save_cnt)
docta/core/preprocess.py:21
↓ 2 callersMethodupdate
(self, dataset_new)
docta/datasets/customize.py:9
↓ 1 callersMethod__getattr__
(self, name)
docta/utils/config.py:573
↓ 1 callersMethod__getitem__
(self, index)
docta/datasets/customize_img_folder.py:23
↓ 1 callersMethod__init__
(self, T)
docta/models/loss_funcs/loss_correction.py:6
↓ 1 callersMethod__init__
(self, alpha_plan = None, noisy_prior = None)
docta/models/loss_funcs/peer_loss.py:29
↓ 1 callersFunction_dataset_cfg
(dataset_name, file_name, label, preprocess = 'raw', label_sel = None,
docta/utils/utils.py:28
↓ 1 callersFunction_expand_onehot_labels
Expand onehot labels to match the size of prediction.
docta/models/loss_funcs/cross_entropy_loss.py:65
↓ 1 callersMethod_file2dict
(filename, use_predefined_variables=True)
docta/utils/config.py:236
↓ 1 callersMethod_forward_impl
(self, x)
docta/models/backbones/resnet.py:195
↓ 1 callersMethod_parse_int_float_bool
(val)
docta/utils/config.py:713
↓ 1 callersMethod_parse_iterable
Parse iterable values in the string. All elements inside '()' or '[]' are treated as iterable values. Args: val (str): V
docta/utils/config.py:729
↓ 1 callersFunction_power_method
(transition_matrix, increase_power=True, max_iter=10000)
docta/utils/LexRank.py:46
↓ 1 callersMethod_pre_substitute_base_vars
Substitute base variable placehoders to string, so that parsing would work.
docta/utils/config.py:185
↓ 1 callersFunction_read_reqs
(relpath)
setup.py:13
↓ 1 callersMethod_substitute_base_vars
Substitute variable strings to their actual values.
docta/utils/config.py:204
↓ 1 callersMethod_substitute_predefined_vars
(filename, temp_config_name)
docta/utils/config.py:164
↓ 1 callersMethod_validate_py_syntax
(filename)
docta/utils/config.py:153
↓ 1 callersFunctionadd_args
(parser, cfg, prefix='')
docta/utils/config.py:108
↓ 1 callersFunctioncalc_func
Optimize over the noise transition matrix T and prior P
docta/core/hoc.py:93
↓ 1 callersFunctioncheck_file_exist
(filename, msg_tmpl='file "{}" does not exist')
docta/utils/config.py:26
↓ 1 callersFunctionconnected_nodes
(matrix)
docta/utils/LexRank.py:69
↓ 1 callersFunctionconsensus_analytical
r""" Compute the first-, second-, and third-order of consensus matrices. Args: cfg: configuration T : noise transition matrix
docta/core/hoc.py:15
↓ 1 callersFunctionconsensus_counts
Count the consensus
docta/core/hoc.py:166
↓ 1 callersFunctioncosDistance
(features)
docta/core/core_utils.py:6
↓ 1 callersFunctioncount_knn_distribution
Count the distribution of KNN Args: cfg: configuration dataset: the data for estimation sample: the index of samples
docta/core/knn.py:9
↓ 1 callersFunctioncreate_markov_matrix_discrete
(weights_matrix, threshold)
docta/utils/LexRank.py:95
↓ 1 callersFunctionestimator_hoc
HOC estimator
docta/core/hoc.py:184
↓ 1 callersFunctionextract_embedding
(cfg, encoder, dataset_list)
docta/core/preprocess.py:33
↓ 1 callersFunctionextract_embedding_batch
(cfg, encoder, batch_feature)
docta/core/preprocess.py:68
↓ 1 callersMethodfilter_data
(self, key = 'Assistant:')
docta/datasets/hh_rlhf.py:133
↓ 1 callersFunctionfunc
Compute the loss of estimated consensus matrices
docta/core/hoc.py:66
↓ 1 callersFunctiongenerate_T_from_diagonal
Randomly generate the label noise transition matrix (T) with given diagonal elements (diag). See ref: https://proceedings.mlr.press/
docta/datasets/data_utils.py:54
↓ 1 callersFunctionget_T_true_from_data
(clean_label, noisy_label)
docta/datasets/data_utils.py:94
↓ 1 callersMethodget_encoder
(self)
docta/core/preprocess.py:95
↓ 1 callersFunctionget_score
Get the corruption score. Lower score indicates the sample is more likely to be corrupted. Args: knn_labels_cnt: KNN labels label
docta/core/knn.py:48
↓ 1 callersFunctionget_value
(cfg, key)
docta/utils/config.py:817
↓ 1 callersFunctionimport_modules_from_strings
Import modules from the given list of strings. Args: imports (list | str | None): The given module names to be imported. allow_fa
docta/utils/config.py:31
↓ 1 callersMethodload_data
(self)
docta/datasets/hh_rlhf.py:102
↓ 1 callersFunctionload_label
(label_path, clean_label = None, key = None, clean_key = None)
docta/datasets/data_utils.py:15
↓ 1 callersMethodload_label
(self)
docta/datasets/cifar.py:36
↓ 1 callersFunctionmean_pooling
(model_output, attention_mask)
docta/core/core_utils.py:15
↓ 1 callersFunctionmulticlass_noisify
Flip classes according to transition probability matrix T.
docta/datasets/data_utils.py:71
↓ 1 callersFunctionnoisify_general
Synthesize class-dependent label noise according to a random T
docta/datasets/data_utils.py:32
↓ 1 callersFunctionparse_args
()
tools/diagnose_tabular.py:15
↓ 1 callersFunctionparse_args
()
tools/docta_rare_pattern.py:17
↓ 1 callersFunctionparse_args
()
tools/diagnose_rlhf.py:16
↓ 1 callersFunctionparse_args
()
tools/cure_red_team_rlhf.py:61
↓ 1 callersFunctionparse_args
()
tools/docta_tabular_rare_pattern.py:17
↓ 1 callersFunctionparse_args
()
tools/cure_hh_rlhf.py:27
↓ 1 callersMethodpreprocess_csv
This function servers to preporcess your dataset for docta use. The code below will do some basic cleaning stuff, then return you the
docta/datasets/csv_loder.py:16
↓ 1 callersFunctionreduce_loss
Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum".
docta/models/loss_funcs/loss_utils.py:56
↓ 1 callersFunctionreplace_value
(cfg)
docta/utils/config.py:822
↓ 1 callersFunctionresnet18_lowres
(num_classes)
docta/models/backbones/resnet_lowres.py:102
↓ 1 callersFunctionscore_from_embedding
Input: embed --> the extracted embedding / features from the given dataset; {array-like, sparse matrix} of shape (n_samples, n_featur
docta/core/get_lr_score.py:25
↓ 1 callersFunctionset_optimizer
(cfg, model)
docta/apis/train.py:11
↓ 1 callersFunctionsimi_feat_batch
Construct the set of data that are likely to be corrupted.
docta/core/knn.py:59
↓ 1 callersMethodsimifeat
(self)
docta/apis/detect.py:32
↓ 1 callersFunctionstationary_distribution
( transition_matrix, increase_power=True, normalized=True, )
docta/utils/LexRank.py:103
↓ 1 callersFunctiontest_model
(cfg, model, dataset)
docta/apis/train.py:27
↓ 1 callersFunctiontrain_epoch
(epoch)
docta/apis/train.py:60
↓ 1 callersFunctionwrapup_results
(dataset, report, warpped_result = [], weight = 1.0)
tools/cure_red_team_rlhf.py:26
Method__call__
(self, parser, namespace, values, option_string=None)
docta/utils/config.py:791
Method__copy__
(self)
docta/utils/config.py:595
Method__deepcopy__
(self, memo)
docta/utils/config.py:602
Method__getattr__
(self, name)
docta/utils/config.py:95
Method__getitem__
(self, name)
docta/utils/config.py:576
Method__getitem__
(self, index)
docta/datasets/csv_loder.py:32
Method__getitem__
(self, index)
docta/datasets/customize.py:16
Method__getitem__
Args: index (int): Index Returns: tuple: (img, (target, noisy_label), index). target: clean lab
docta/datasets/cifar.py:46
Method__getstate__
(self)
docta/utils/config.py:592
Method__init__
(self, cfg_dict=None, cfg_text=None, filename=None)
docta/utils/config.py:441
Method__init__
(self, **kwargs)
docta/core/report.py:2
Method__init__
(self, cfg, dataset, test_dataset=None)
docta/core/preprocess.py:90
Method__init__
(self, cfg, dataset, model = None, report = None)
docta/apis/diagnose.py:11
Method__init__
(self, cfg, data, report = None)
docta/apis/detect.py:87
next →1–100 of 186, ranked by callers