Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/davidstutz/confidence-calibrated-adversarial-training
/ functions
Functions
916 in github.com/davidstutz/confidence-calibrated-adversarial-training
⨍
Functions
916
◇
Types & classes
159
↓ 560 callers
Method
distributionAt
(self, label, confidence, labels=10)
tests/test_eval.py:12
↓ 171 callers
Method
confidence_at_tpr
Confidence threshold for given true positive rate. :param tpr: true positive rate in [0, 1] :type tpr: float :return
common/eval/adversarial_evaluation.py:249
↓ 114 callers
Method
confidence_at_tpr
Confidence threshold for given true positive rate. :param tpr: true positive rate in [0, 1] ;type tpr: float :return
common/eval/distal_evaluation.py:179
↓ 87 callers
Method
add_scalar
Add scalar value. :param tag: tag for scalar :type tag: str :param value: value :type value: mixed :
common/summary.py:55
↓ 73 callers
Method
confidence_at_tpr
Confidence threshold for given true positive rate. :param tpr: true positive rate in [0, 1] ;type tpr: float :return
common/eval/corrupted_evaluation.py:188
↓ 70 callers
Method
detach
Detach a key. :param key: log file name :type key: str
common/log.py:179
↓ 64 callers
Method
fpr_at_confidence
False positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/adversarial_evaluation.py:304
↓ 64 callers
Method
tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/adversarial_evaluation.py:275
↓ 62 callers
Method
test_error_at_confidence
Test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :return tes
common/eval/adversarial_evaluation.py:350
↓ 58 callers
Method
robust_test_error_at_confidence
Robust test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :ret
common/eval/adversarial_evaluation.py:428
↓ 51 callers
Function
log
Quick access to logger instance. :param message: message or variable to log :type message: mixed :param level: level, i.e. color
common/log.py:244
↓ 50 callers
Method
append_layer
Add a layer. :param name: layer name :type name: str :param layer: layer :type layer: torch.nn.Module
models/classifier.py:90
↓ 45 callers
Method
confidence_at_tpr
Confidence threshold for given true positive rate. :param tpr: true positive rate in [0, 1] :type tpr: float :return
common/eval/clean_evaluation.py:98
↓ 44 callers
Method
fpr_at_confidence
False positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/distal_evaluation.py:282
↓ 44 callers
Method
tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/distal_evaluation.py:205
↓ 42 callers
Method
runTestAttackPerformance
(self, attack, attempts=5, objective=attacks.objectives.UntargetedF0Objective())
tests/test_attacks_normal.py:104
↓ 40 callers
Method
add_histogram
Add histogram data. :param tag: tag :type tag: str :param values: values :type values: torch.Tensor or numpy
common/summary.py:87
↓ 35 callers
Method
load
Load a state. :param filepath: file to load :type filepath: str :return: state :rtype: State
common/state.py:96
↓ 32 callers
Method
test_error_at_confidence
Test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :return tes
common/eval/corrupted_evaluation.py:265
↓ 31 callers
Method
corrupted_test_error_at_confidence
Test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :return tes
common/eval/corrupted_evaluation.py:313
↓ 31 callers
Method
test
Test step. :param epoch: epoch :type epoch: int
common/train/normal_training.py:145
↓ 30 callers
Method
tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/clean_evaluation.py:121
↓ 29 callers
Method
step
Training + test step. :param epoch: epoch :type epoch: int
common/train/training_interface.py:65
↓ 27 callers
Method
add_text
Add images. :param tag: tag :type tag: str :param text_string: test :type text_string: str :param gl
common/summary.py:161
↓ 26 callers
Method
test_error
Test error. :return: test error :rtype: float
common/eval/adversarial_evaluation.py:340
↓ 25 callers
Function
data_file
Generate path to data file. :param name: name of file :type name: str :param ext: extension (including period) :type ext: str
common/paths.py:38
↓ 24 callers
Method
fpr_at_confidence
False positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/corrupted_evaluation.py:351
↓ 24 callers
Method
robust_test_error
Robust test error. :return: robust test error :rtype: float
common/eval/adversarial_evaluation.py:388
↓ 24 callers
Method
test_error
Test error. :return: test error :rtype: float
common/eval/clean_evaluation.py:158
↓ 24 callers
Method
tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/corrupted_evaluation.py:214
↓ 22 callers
Method
main
Main.
experiments/train.py:50
↓ 21 callers
Method
runTestAttackProjections
(self, attack, epsilon, objective=attacks.objectives.UntargetedF0Objective())
tests/test_attacks_normal.py:88
↓ 19 callers
Function
__attack_config
Attack configuration. :param directory: directory for perturbations :type directory: str :param attack: attack :type attack: att
experiments/config/common.py:1092
↓ 18 callers
Method
forward
(self, x_nat, y_nat)
attacks/batch_corner_search.py:172
↓ 17 callers
Function
__untargeted_f0
Untargeted loss objective, default is cross-entropy. :param loss: loss to maximize :type loss: callable :return: objective :rtyp
experiments/config/common.py:883
↓ 15 callers
Method
checkpoint
Quick access to State.save. :param filepath: path to file :type filepath: str :param model: model :type mode
common/state.py:76
↓ 15 callers
Method
flush
Flush.
common/summary.py:177
↓ 14 callers
Method
set
Set true or target classes. Target classes might be None for untargeted attacks. :param true_classes: true classes :type tru
attacks/objectives.py:22
↓ 13 callers
Method
corrupted_test_error
Test error. :return: test error :rtype: float
common/eval/corrupted_evaluation.py:303
↓ 12 callers
Method
run
Run attack. :param model: model to attack :type model: torch.nn.Module :param images: images :type images: t
attacks/attack.py:19
↓ 12 callers
Method
test_error
Test error. :return: test error :rtype: float
common/eval/corrupted_evaluation.py:255
↓ 11 callers
Method
__init__
(self, indices=None, resize=None)
common/datasets.py:431
↓ 9 callers
Method
save
Save the state. :param filepath: file to save to :type filepath: str
common/state.py:37
↓ 8 callers
Method
success
Get success. :param logits: logit output of the network :type logits: torch.autograd.Variable :return: success
attacks/objectives.py:57
↓ 8 callers
Method
test_error_at_confidence
Test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :return tes
common/eval/clean_evaluation.py:168
↓ 7 callers
Method
get_instance
Get current log instance, simple singleton. :return: log :rtype: Log
common/log.py:204
↓ 7 callers
Method
progress
Report progress. :param epoch: epoch :type epoch: int :param batch: batch :type batch: int :param ba
common/train/training_interface.py:26
↓ 7 callers
Method
receiver_operating_characteristic_auc
Computes the ROC curve for correct classified vs. incorrect classified. :return: ROC AUC score :rtype: float
common/eval/clean_evaluation.py:216
↓ 7 callers
Method
runTestAttackPerformance
(self, attack, attempts=5)
tests/test_distal_attacks_normal.py:82
↓ 7 callers
Function
save_latex
Save latex file. :param filepath: path to file :rtype filepath: str :param latex: latex code :type latex: str
experiments/eval/misc.py:522
↓ 7 callers
Method
target_confidence
True confidence. :param logits: logit output of the network :type logits: torch.autograd.Variable :return: true conf
attacks/objectives.py:88
↓ 7 callers
Method
true_confidence
True confidence. :param logits: logit output of the network :type logits: torch.autograd.Variable :return: true conf
attacks/objectives.py:72
↓ 7 callers
Method
validate
Check validity.
common/experiments.py:410
↓ 6 callers
Method
add_images
Add images. :param tag: tag :type tag: str :param img_tensor: images :type img_tensor: torch.Tensor or numpy
common/summary.py:125
↓ 6 callers
Method
runTestAttackPerformance
(self, attack, attempts=5, objective=attacks.objectives.UntargetedF0Objective())
tests/test_attacks_adversarial.py:94
↓ 6 callers
Method
testTrainModel
(self, model)
tests/test_train_models.py:27
↓ 6 callers
Method
update_queue
Update queue.
common/summary.py:587
↓ 5 callers
Method
__init__
Constructor. :param args: shape :type args: [int]
common/torch.py:701
↓ 5 callers
Method
alternative_robust_test_error_at_confidence
Robust test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :ret
common/eval/adversarial_evaluation.py:398
↓ 5 callers
Method
fpr_at_99tpr
Test error at 95%TPR. :return: robust test error :rtype: float
common/eval/clean_evaluation.py:382
↓ 5 callers
Method
fpr_at_confidence
False positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/clean_evaluation.py:146
↓ 5 callers
Method
receiver_operating_characteristic_auc
Computes the ROC curve for correct classified vs. incorrect classified. :return: ROC AUC score :rtype: float
common/eval/adversarial_evaluation.py:550
↓ 5 callers
Method
robust_test_error_at_99tpr
Robust test error at 95%TPR. :return: robust test error :rtype: float
common/eval/adversarial_evaluation.py:876
↓ 4 callers
Method
__init__
Constructor.
common/experiments.py:393
↓ 4 callers
Method
_make_layer
(self, block, planes, num_blocks, stride)
models/preact_resnet.py:65
↓ 4 callers
Method
confidence_at_99tpr
Test error at 95%TPR. :return: robust test error :rtype: float
common/eval/clean_evaluation.py:262
↓ 4 callers
Function
expand_as
Expands the tensor using view to allow broadcasting. :param tensor: input tensor :type tensor: torch.Tensor or torch.autograd.Variable
common/torch.py:437
↓ 4 callers
Method
fmargin
(self, x, y)
attacks/batch_cube2.py:12
↓ 4 callers
Method
log
Log a message. :param message: message or variable to log :type message: mixed :param level: level, i.e. color
common/log.py:226
↓ 4 callers
Function
p_selection
The schedule was adapted for mnist/cifar10, but not for imagenet
attacks/batch_cube2.py:22
↓ 4 callers
Method
runTestDeterministicAttack
(self, attack, objective=attacks.objectives.UntargetedF0Objective())
tests/test_attacks_normal.py:122
↓ 4 callers
Method
success_rate
Success rate. :return: success rate :rtype: float
common/eval/adversarial_evaluation.py:499
↓ 4 callers
Method
success_rate_at_confidence
Success rate at confidence threshold. :param threshold: confidence threshold :type threshold: float :return: success
common/eval/adversarial_evaluation.py:509
↓ 4 callers
Method
test_error_at_confidence
Test error for given confidence threshold. :param threshold: confidence threshold :type threshold: float :return tes
common/eval/distal_evaluation.py:244
↓ 4 callers
Method
timestamp
Print timestamp. :return: date and time :rtype: str
common/log.py:88
↓ 4 callers
Method
tnr_at_confidence
True negative rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/corrupted_evaluation.py:226
↓ 4 callers
Method
tnr_at_confidence
False positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/adversarial_evaluation.py:328
↓ 4 callers
Method
tnr_at_confidence
False positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/distal_evaluation.py:294
↓ 4 callers
Method
validation_tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/corrupted_evaluation.py:238
↓ 4 callers
Method
validation_tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/adversarial_evaluation.py:287
↓ 4 callers
Method
validation_tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/clean_evaluation.py:133
↓ 4 callers
Method
validation_tpr_at_confidence
True positive rate at confidence threshold. :param threshold: confidence threshold in [0, 1] :type threshold: float
common/eval/distal_evaluation.py:217
↓ 3 callers
Method
__init__
(self, min=0, max=1, name=None, deterministic=False, random_state=None)
common/imgaug.py:49
↓ 3 callers
Method
_files
Get files. :return: files :rtype: [File]
common/log.py:193
↓ 3 callers
Method
_wide_layer
(self, block, planes, blocks, stride)
models/wide_resnet.py:104
↓ 3 callers
Method
elapsed
Get elapsed time in seconds :return: elapsed time in seconds :rtype: float
common/timer.py:24
↓ 3 callers
Function
flat2square
returns the position and the perturbation given the index of an image of the batch of all the possible perturbations
attacks/batch_corner_search.py:72
↓ 3 callers
Method
getModelFile
(cls)
tests/test_attacks_normal.py:69
↓ 3 callers
Method
getModelFile
(cls)
tests/test_distal_attacks_normal.py:65
↓ 3 callers
Method
getModelFile
(cls)
tests/test_attacks_adversarial.py:75
↓ 3 callers
Function
is_cuda
Check if model/tensor is on CUDA. :param mixed: model or tensor :type mixed: torch.nn.Module or torch.autograd.Variable or torch.Tensor
common/torch.py:46
↓ 3 callers
Method
kwargs_get
Get argument if not None. :param key: key :type key: str :param default: default value :type default: mixed
models/classifier.py:73
↓ 3 callers
Function
makedir
Creates directory if it does not exist. :param dir: directory path :type dir: str
common/utils.py:210
↓ 3 callers
Method
normalize
Normalization. :param gradients: gradients :type gradients: torch.autograd.Variable
attacks/norms.py:20
↓ 3 callers
Method
receiver_operating_characteristic_auc
Computes the ROC curve for correct classified vs. incorrect classified. :return: ROC AUC score :rtype: float
common/eval/distal_evaluation.py:325
↓ 3 callers
Method
run
Run attack. :param model: model to attack :type model: torch.nn.Module :param images: images :type images: t
attacks/batch_gradient_descent.py:54
↓ 3 callers
Method
test_error
Test error. :return: test error :rtype: float
common/eval/distal_evaluation.py:234
↓ 3 callers
Method
test_error_at_99tpr
Test error at 95%TPR. :return: robust test error :rtype: float
common/eval/adversarial_evaluation.py:796
↓ 2 callers
Function
__adversarial_training
Adversarial training configuration. :param directory: directory for models :type directory: str :param attack: attack for adversaria
experiments/config/common.py:986
↓ 2 callers
Method
__init__
Constructor.
attacks/objectives.py:11
next →
1–100 of 916, ranked by callers