SYMBOL INDEX (1573 symbols across 196 files) FILE: examples/ai_fuzzer/fuzz_testing_and_model_enhense.py function split_dataset (line 41) | def split_dataset(image, label, proportion): function example_lenet_mnist_fuzzing (line 55) | def example_lenet_mnist_fuzzing(): FILE: examples/ai_fuzzer/lenet5_mnist_coverage.py function test_lenet_mnist_coverage (line 31) | def test_lenet_mnist_coverage(): FILE: examples/ai_fuzzer/lenet5_mnist_fuzzing.py function test_lenet_mnist_fuzzing (line 31) | def test_lenet_mnist_fuzzing(): FILE: examples/ai_fuzzer/lenet5_mnist_scc.py function datapipe (line 32) | def datapipe(path): class Net (line 47) | class Net(nn.Cell): method __init__ (line 49) | def __init__(self): method construct (line 61) | def construct(self, x): FILE: examples/common/dataset/data_processing.py function generate_mnist_dataset (line 24) | def generate_mnist_dataset(data_path, batch_size=32, repeat_size=1, function vgg_create_dataset100 (line 68) | def vgg_create_dataset100(data_home, image_size, batch_size, rank_id=0, ... function create_dataset_imagenet (line 120) | def create_dataset_imagenet(path, batch_size=32, repeat_size=20, status=... function create_dataset_cifar (line 158) | def create_dataset_cifar(data_path, image_height, image_width, repeat_nu... function generate_dataset_cifar (line 194) | def generate_dataset_cifar(data_path, batch_size, usage, repeat_num=1): FILE: examples/common/networks/cifar10cnn/cifar10cnn_net.py function weight_variable (line 21) | def weight_variable(): function conv (line 24) | def conv(in_channels, out_channels, kernel_size, stride=1, padding=0): function fc_with_initialize (line 31) | def fc_with_initialize(input_channels, out_channels): class CIFAR10CNN (line 36) | class CIFAR10CNN(nn.Cell): method __init__ (line 40) | def __init__(self): method construct (line 100) | def construct(self, x): method forward_from (line 109) | def forward_from(self, x, layer): method get_layer_output (line 132) | def get_layer_output(self, x, targetlayer): FILE: examples/common/networks/cifar10cnn/cifar_train.py function cifar_train (line 36) | def cifar_train(epoch_size, lr, momentum): FILE: examples/common/networks/lenet5/lenet5_net.py function conv (line 18) | def conv(in_channels, out_channels, kernel_size, stride=1, padding=0): function fc_with_initialize (line 25) | def fc_with_initialize(input_channels, out_channels): function weight_variable (line 31) | def weight_variable(): class LeNet5 (line 35) | class LeNet5(nn.Cell): method __init__ (line 39) | def __init__(self): method construct (line 50) | def construct(self, x): FILE: examples/common/networks/lenet5/lenet5_net_for_fuzzing.py function conv (line 22) | def conv(in_channels, out_channels, kernel_size, stride=1, padding=0): function fc_with_initialize (line 29) | def fc_with_initialize(input_channels, out_channels): function weight_variable (line 36) | def weight_variable(): class LeNet5 (line 41) | class LeNet5(nn.Cell): method __init__ (line 45) | def __init__(self): method construct (line 57) | def construct(self, x): FILE: examples/common/networks/lenet5/mnist_train.py function mnist_train (line 34) | def mnist_train(epoch_size, batch_size, lr, momentum): FILE: examples/common/networks/resnet/resnet.py function _conv_variance_scaling_initializer (line 26) | def _conv_variance_scaling_initializer(in_channel, out_channel, kernel_s... function _weight_variable (line 36) | def _weight_variable(shape, factor=0.01): function _conv3x3 (line 41) | def _conv3x3(in_channel, out_channel, stride=1, use_se=False): function _conv1x1 (line 51) | def _conv1x1(in_channel, out_channel, stride=1, use_se=False): function _conv7x7 (line 61) | def _conv7x7(in_channel, out_channel, stride=1, use_se=False): function _bn (line 71) | def _bn(channel): function _bn_last (line 76) | def _bn_last(channel): function _fc (line 81) | def _fc(in_channel, out_channel, use_se=False): class ResidualBlock (line 91) | class ResidualBlock(nn.Cell): method __init__ (line 110) | def __init__(self, method construct (line 160) | def construct(self, x): class ResNet (line 193) | class ResNet(nn.Cell): method __init__ (line 218) | def __init__(self, method _make_layer (line 278) | def _make_layer(self, block, layer_num, in_channel, out_channel, strid... method construct (line 311) | def construct(self, x): function resnet50 (line 341) | def resnet50(class_num=10): function se_resnet50 (line 361) | def se_resnet50(class_num=1001): function resnet101 (line 382) | def resnet101(class_num=1001): FILE: examples/common/networks/vgg/crossentropy.py class CrossEntropy (line 24) | class CrossEntropy(_Loss): method __init__ (line 27) | def __init__(self, smooth_factor=0., num_classes=1001): method construct (line 35) | def construct(self, logit, label): FILE: examples/common/networks/vgg/linear_warmup.py function linear_warmup_lr (line 20) | def linear_warmup_lr(current_step, warmup_steps, base_lr, init_lr): FILE: examples/common/networks/vgg/utils/util.py function get_param_groups (line 18) | def get_param_groups(network): FILE: examples/common/networks/vgg/utils/var_init.py function _calculate_gain (line 25) | def _calculate_gain(nonlinearity, param=None): function _assignment (line 67) | def _assignment(arr, num): function _calculate_in_and_out (line 81) | def _calculate_in_and_out(arr): function _select_fan (line 105) | def _select_fan(array, mode): class KaimingInit (line 115) | class KaimingInit(init.Initializer): method __init__ (line 129) | def __init__(self, a=0, mode='fan_in', nonlinearity='leaky_relu'): method _initialize (line 133) | def _initialize(self, arr): class KaimingUniform (line 137) | class KaimingUniform(KaimingInit): method _initialize (line 156) | def _initialize(self, arr): class KaimingNormal (line 165) | class KaimingNormal(KaimingInit): method _initialize (line 184) | def _initialize(self, arr): function default_recurisive_init (line 193) | def default_recurisive_init(custom_cell): FILE: examples/common/networks/vgg/vgg.py function _make_layer (line 26) | def _make_layer(base, args, batch_norm): class Vgg (line 53) | class Vgg(nn.Cell): method __init__ (line 71) | def __init__(self, base, num_classes=1000, batch_norm=False, batch_siz... method construct (line 91) | def construct(self, x): method custom_init_weight (line 97) | def custom_init_weight(self): function vgg16 (line 125) | def vgg16(num_classes=1000, args=None, phase="train"): FILE: examples/common/networks/vgg/warmup_cosine_annealing_lr.py function warmup_cosine_annealing_lr (line 24) | def warmup_cosine_annealing_lr(lr, steps_per_epoch, warmup_epochs, max_e... FILE: examples/common/networks/vgg/warmup_step_lr.py function lr_steps (line 24) | def lr_steps(global_step, lr_init, lr_max, warmup_epochs, total_epochs, ... function warmup_step_lr (line 50) | def warmup_step_lr(lr, lr_epochs, steps_per_epoch, warmup_epochs, max_ep... function multi_step_lr (line 75) | def multi_step_lr(lr, milestones, steps_per_epoch, max_epoch, gamma=0.1): function step_lr (line 79) | def step_lr(lr, epoch_size, steps_per_epoch, max_epoch, gamma=0.1): FILE: examples/community/face_adversarial_attack/adversarial_attack.py class FaceAdversarialAttack (line 32) | class FaceAdversarialAttack(): method __init__ (line 42) | def __init__(self, input_img, target_img, net, seed=None): method train (line 62) | def train(self, attack_method): method test_target_attack (line 110) | def test_target_attack(self): method test_non_target_attack (line 141) | def test_non_target_attack(self): method _reverse_norm (line 168) | def _reverse_norm(self, image_tensor): function apply (line 182) | def apply(image_tensor, mask_tensor, reference_tensor): function create_mask (line 199) | def create_mask(face_image): function detect_face (line 235) | def detect_face(image): function load_data (line 258) | def load_data(data): FILE: examples/community/face_adversarial_attack/loss_design.py class MyTrainOneStepCell (line 22) | class MyTrainOneStepCell(nn.TrainOneStepCell): method __init__ (line 35) | def __init__(self, network, optimizer, sens=1.0): method construct (line 39) | def construct(self, *inputs): class MyWithLossCellTargetAttack (line 47) | class MyWithLossCellTargetAttack(nn.Cell): method __init__ (line 49) | def __init__(self, net, loss_fn, input_tensor): method backbone_network (line 62) | def backbone_network(self): method construct (line 65) | def construct(self, mask_tensor): class MyWithLossCellNonTargetAttack (line 76) | class MyWithLossCellNonTargetAttack(nn.Cell): method __init__ (line 78) | def __init__(self, net, loss_fn, input_tensor): method backbone_network (line 91) | def backbone_network(self): method construct (line 94) | def construct(self, mask_tensor): class FaceLossTargetAttack (line 105) | class FaceLossTargetAttack(nn.Cell): method __init__ (line 108) | def __init__(self, target_emb): method construct (line 122) | def construct(self, adversarial_emb): class FaceLossNoTargetAttack (line 131) | class FaceLossNoTargetAttack(nn.Cell): method __init__ (line 134) | def __init__(self): method construct (line 148) | def construct(self, adversarial_emb, input_emb): FILE: examples/community/query_attack_detector/query_detector.py class QueryDetector (line 32) | class QueryDetector(Detector): method __init__ (line 70) | def __init__(self, sample_query, window_size=50, step_size=1, roundto=... method preprocess (line 91) | def preprocess(self, array, roundto=1, normalized=False): method hash_img (line 110) | def hash_img(self, img, window_size, roundto, step_size, preprocess=Tr... method check_img (line 135) | def check_img(self, hashes): method add_img (line 152) | def add_img(self, img): method fit (line 171) | def fit(self, inputs, labels=None): method detect (line 189) | def detect(self, queries): method gaussian_filter (line 217) | def gaussian_filter(self, img): method detect_diff (line 228) | def detect_diff(self, inputs): method transform (line 244) | def transform(self, inputs): method delete (line 257) | def delete(self): function hash_helper (line 264) | def hash_helper(arguments): # compute hashes FILE: examples/community/speech_adversarial_attack/attack.py function superpose (line 84) | def superpose(audio, noise): function sr_and_cer (line 110) | def sr_and_cer(sound_data, noise): function generate_data (line 140) | def generate_data(num, alpha): class MyAdam (line 212) | class MyAdam(ms.nn.Cell): method __init__ (line 217) | def __init__(self, param): method construct (line 227) | def construct( function superpose_step (line 248) | def superpose_step(sound, noise, start): function generate (line 274) | def generate( FILE: examples/community/speech_adversarial_attack/dataset.py class LoadAudioAndTranscript (line 30) | class LoadAudioAndTranscript: method __init__ (line 35) | def __init__(self, audio_conf=None, normalize=False, labels=None): method load_audio (line 45) | def load_audio(path): method parse_audio (line 58) | def parse_audio(self, audio_path): method parse_transcript (line 81) | def parse_transcript(self, transcript_path): class ASRDataset (line 91) | class ASRDataset(LoadAudioAndTranscript): method __init__ (line 103) | def __init__( method __getitem__ (line 128) | def __getitem__(self, index): method __len__ (line 152) | def __len__(self): class DistributedSampler (line 156) | class DistributedSampler: method __init__ (line 161) | def __init__(self, dataset, rank, group_size, shuffle=True, seed=0): method __iter__ (line 171) | def __iter__(self): method __len__ (line 183) | def __len__(self): function create_dataset (line 187) | def create_dataset( FILE: examples/community/speech_adversarial_attack/src/deepspeech2.py class SequenceWise (line 26) | class SequenceWise(nn.Cell): method __init__ (line 31) | def __init__(self, module): method construct (line 38) | def construct(self, x): method _initialize_weights (line 46) | def _initialize_weights(self): class MaskConv (line 74) | class MaskConv(nn.Cell): method __init__ (line 80) | def __init__(self): method construct (line 107) | def construct(self, x, lengths): method _initialize_weights (line 113) | def _initialize_weights(self): class BatchRNN (line 143) | class BatchRNN(nn.Cell): method __init__ (line 156) | def __init__( method construct (line 204) | def construct(self, x): class DeepSpeechModel (line 216) | class DeepSpeechModel(nn.Cell): method __init__ (line 229) | def __init__( method construct (line 281) | def construct(self, x, lengths): method get_seq_lens (line 294) | def get_seq_lens(self, seq_len): method get_conv_num (line 305) | def get_conv_num(self): class NetWithLossClass (line 320) | class NetWithLossClass(nn.Cell): method __init__ (line 325) | def __init__(self, network): method construct (line 333) | def construct(self, inputs, input_length, target_indices, label_values): class PredictWithSoftmax (line 344) | class PredictWithSoftmax(nn.Cell): method __init__ (line 349) | def __init__(self, network): method construct (line 356) | def construct(self, inputs, input_length): FILE: examples/community/speech_adversarial_attack/src/greedydecoder.py class Decoder (line 24) | class Decoder: method __init__ (line 34) | def __init__(self, labels, blank_index=0): method wer (line 45) | def wer(str_1, str_2): method cer (line 66) | def cer(str_1, str_2): method decode (line 83) | def decode(self, probs, sizes=None): class MSGreedyDecoder (line 98) | class MSGreedyDecoder(Decoder): method convert_to_strings (line 103) | def convert_to_strings( method process_string (line 121) | def process_string(self, sequence, size, remove_repetitions=False): method decode (line 144) | def decode(self, probs, sizes=None): FILE: examples/community/speech_adversarial_attack/stft.py class DFTBase (line 11) | class DFTBase(nn.Cell): method dft_matrix (line 16) | def dft_matrix(self, num): method idft_matrix (line 25) | def idft_matrix(self, num): class STFT (line 35) | class STFT(DFTBase): method __init__ (line 40) | def __init__( method construct (line 115) | def construct(self, input_x): function magphase (line 139) | def magphase(real, imag): function ms_spectrogram (line 149) | def ms_spectrogram(sound, ms_stft): FILE: examples/model_protection/qwen2_5/infer/network_patch/qwen2_5_7b_instruct_ms_network_obfuscate.py class VocabEmbedding (line 29) | class VocabEmbedding(nn.Cell): method __init__ (line 48) | def __init__(self, num_embeddings, embedding_dim, param_init_type=msty... method construct (line 58) | def construct(self, input_ids): function _patched_init (line 64) | def _patched_init(self, config, *args, **kwargs): function _patched_construct (line 82) | def _patched_construct(self, tokens: Tensor, batch_valid_length=None, ba... function _patched_infer_convert_outer_weight (line 147) | def _patched_infer_convert_outer_weight(self, src_hf_dir, hf_weight_map): function _patched_convert_weight_name (line 175) | def _patched_convert_weight_name(self, weight_name: str): FILE: examples/model_protection/qwen2_5/infer/network_patch/qwen2_5_7b_instruct_ms_network_obfuscate_emb.py function _patched_init (line 28) | def _patched_init(self, config, *args, **kwargs): function _patched_construct (line 40) | def _patched_construct(self, tokens: Tensor, batch_valid_length=None, ba... function _patched_infer_convert_outer_weight (line 103) | def _patched_infer_convert_outer_weight(self, src_hf_dir, hf_weight_map): function _patched_convert_weight_name (line 126) | def _patched_convert_weight_name(self, weight_name: str): FILE: examples/model_protection/qwen2_5/infer/qwen2_5_7b_instruct_obfuscate_inference.py function test_qwen2_5_obfuscate_inference (line 29) | def test_qwen2_5_obfuscate_inference(model_path): FILE: examples/model_protection/qwen2_5/obfuscation/qwen2_5_7b_instruct_weight_obfuscate.py function inv_permutation (line 20) | def inv_permutation(p): function gen_colums_permuate_list (line 26) | def gen_colums_permuate_list(hidden_size, num_heads=None, kv_num_heads=N... function test_qwen2_5_weight_obfuscate (line 53) | def test_qwen2_5_weight_obfuscate(src_path, saved_path, obf_config_path): function test_qwen2_5_weight_obfuscate_emb (line 76) | def test_qwen2_5_weight_obfuscate_emb(src_path, saved_path, obf_config_p... FILE: examples/model_security/model_attacks/black_box/mnist_attack_genetic.py class ModelToBeAttacked (line 35) | class ModelToBeAttacked(BlackModel): method __init__ (line 38) | def __init__(self, network): method predict (line 42) | def predict(self, inputs): function test_genetic_attack_on_mnist (line 51) | def test_genetic_attack_on_mnist(): FILE: examples/model_security/model_attacks/black_box/mnist_attack_hsja.py class ModelToBeAttacked (line 32) | class ModelToBeAttacked(BlackModel): method __init__ (line 35) | def __init__(self, network): method predict (line 39) | def predict(self, inputs): function random_target_labels (line 47) | def random_target_labels(true_labels): function create_target_images (line 58) | def create_target_images(dataset, data_labels, target_labels): function test_hsja_mnist_attack (line 68) | def test_hsja_mnist_attack(): FILE: examples/model_security/model_attacks/black_box/mnist_attack_nes.py class ModelToBeAttacked (line 32) | class ModelToBeAttacked(BlackModel): method __init__ (line 35) | def __init__(self, network): method predict (line 39) | def predict(self, inputs): function random_target_labels (line 47) | def random_target_labels(true_labels, labels_list): function _pseudorandom_target (line 58) | def _pseudorandom_target(index, total_indices, true_class): function create_target_images (line 67) | def create_target_images(dataset, data_labels, target_labels): function test_nes_mnist_attack (line 77) | def test_nes_mnist_attack(): FILE: examples/model_security/model_attacks/black_box/mnist_attack_pointwise.py class ModelToBeAttacked (line 34) | class ModelToBeAttacked(BlackModel): method __init__ (line 37) | def __init__(self, network): method predict (line 41) | def predict(self, inputs): function test_pointwise_attack_on_mnist (line 49) | def test_pointwise_attack_on_mnist(): FILE: examples/model_security/model_attacks/black_box/mnist_attack_pso.py class ModelToBeAttacked (line 35) | class ModelToBeAttacked(BlackModel): method __init__ (line 38) | def __init__(self, network): method predict (line 42) | def predict(self, inputs): function test_pso_attack_on_mnist (line 51) | def test_pso_attack_on_mnist(): FILE: examples/model_security/model_attacks/black_box/mnist_attack_salt_and_pepper.py class ModelToBeAttacked (line 34) | class ModelToBeAttacked(BlackModel): method __init__ (line 37) | def __init__(self, network): method predict (line 41) | def predict(self, inputs): function test_salt_and_pepper_attack_on_mnist (line 49) | def test_salt_and_pepper_attack_on_mnist(): FILE: examples/model_security/model_attacks/cv/faster_rcnn/coco_attack_genetic.py class ModelToBeAttacked (line 40) | class ModelToBeAttacked(BlackModel): method __init__ (line 43) | def __init__(self, network): method predict (line 47) | def predict(self, images, img_metas, gt_boxes, gt_labels, gt_num): FILE: examples/model_security/model_attacks/cv/faster_rcnn/coco_attack_pgd.py class LossNet (line 43) | class LossNet(Cell): method construct (line 45) | def construct(self, x1, x2, x3, x4, x5, x6): class WithLossCell (line 49) | class WithLossCell(Cell): method __init__ (line 51) | def __init__(self, backbone, loss_fn): method construct (line 56) | def construct(self, img_data, img_metas, gt_bboxes, gt_labels, gt_num,... method backbone_network (line 61) | def backbone_network(self): class GradWrapWithLoss (line 65) | class GradWrapWithLoss(Cell): method __init__ (line 70) | def __init__(self, network): method construct (line 75) | def construct(self, *inputs): FILE: examples/model_security/model_attacks/cv/faster_rcnn/coco_attack_pso.py class ModelToBeAttacked (line 40) | class ModelToBeAttacked(BlackModel): method __init__ (line 43) | def __init__(self, network): method predict (line 47) | def predict(self, images, img_metas, gt_boxes, gt_labels, gt_num): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/anchor_generator.py class AnchorGenerator (line 19) | class AnchorGenerator(): method __init__ (line 21) | def __init__(self, base_size, scales, ratios, scale_major=True, ctr=No... method gen_base_anchors (line 30) | def gen_base_anchors(self): method _meshgrid (line 58) | def _meshgrid(self, x, y, row_major=True): method grid_anchors (line 67) | def grid_anchors(self, featmap_size, stride=16): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/bbox_assign_sample.py class BboxAssignSample (line 26) | class BboxAssignSample(nn.Cell): method __init__ (line 47) | def __init__(self, config, batch_size, num_bboxes, add_gt_as_proposals): method construct (line 102) | def construct(self, gt_bboxes_i, gt_labels_i, valid_mask, bboxes, gt_v... FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/bbox_assign_sample_stage2.py class BboxAssignSampleForRcnn (line 26) | class BboxAssignSampleForRcnn(nn.Cell): method __init__ (line 47) | def __init__(self, config, batch_size, num_bboxes, add_gt_as_proposals): method construct (line 112) | def construct(self, gt_bboxes_i, gt_labels_i, valid_mask, bboxes, gt_v... FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/faster_rcnn_r50.py class Faster_Rcnn_Resnet50 (line 35) | class Faster_Rcnn_Resnet50(nn.Cell): method __init__ (line 54) | def __init__(self, config): method construct (line 197) | def construct(self, img_data, img_metas, gt_bboxes, gt_labels, gt_vali... method get_det_bboxes (line 299) | def get_det_bboxes(self, cls_logits, reg_logits, mask_logits, rois, im... method multiclass_nms (line 331) | def multiclass_nms(self, boxes_all, scores_all, mask_all): method get_anchors (line 408) | def get_anchors(self, featmap_sizes): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/fpn_neck.py function bias_init_zeros (line 29) | def bias_init_zeros(shape): function _conv (line 33) | def _conv(in_channels, out_channels, kernel_size=3, stride=1, padding=0,... class FeatPyramidNeck (line 43) | class FeatPyramidNeck(nn.Cell): method __init__ (line 68) | def __init__(self, method construct (line 94) | def construct(self, inputs): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/proposal_generator.py class Proposal (line 30) | class Proposal(nn.Cell): method __init__ (line 49) | def __init__(self, method set_train_local (line 113) | def set_train_local(self, config, training=True): method construct (line 140) | def construct(self, rpn_cls_score_total, rpn_bbox_pred_total, anchor_l... method get_bboxes_single (line 158) | def get_bboxes_single(self, cls_scores, bbox_preds, mlvl_anchors): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/rcnn.py class DenseNoTranpose (line 28) | class DenseNoTranpose(nn.Cell): method __init__ (line 30) | def __init__(self, input_channels, output_channels, weight_init): method construct (line 40) | def construct(self, x): class Rcnn (line 45) | class Rcnn(nn.Cell): method __init__ (line 64) | def __init__(self, method construct (line 129) | def construct(self, featuremap, bbox_targets, labels, mask): method loss (line 150) | def loss(self, cls_score, bbox_pred, bbox_targets, bbox_weights, label... FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/resnet50.py function weight_init_ones (line 30) | def weight_init_ones(shape): function _conv (line 35) | def _conv(in_channels, out_channels, kernel_size=3, stride=1, padding=0,... function _BatchNorm2dInit (line 44) | def _BatchNorm2dInit(out_chls, momentum=0.1, affine=True, use_batch_stat... class ResNetFea (line 56) | class ResNetFea(nn.Cell): method __init__ (line 76) | def __init__(self, method _make_layer (line 127) | def _make_layer(self, block, layer_num, in_channel, out_channel, strid... method construct (line 147) | def construct(self, x): class ResidualBlockUsing (line 164) | class ResidualBlockUsing(nn.Cell): method __init__ (line 185) | def __init__(self, method construct (line 229) | def construct(self, x): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/roi_align.py class ROIAlign (line 28) | class ROIAlign(nn.Cell): method __init__ (line 38) | def __init__(self, method construct (line 51) | def construct(self, features, rois): method __repr__ (line 54) | def __repr__(self): class SingleRoIExtractor (line 61) | class SingleRoIExtractor(nn.Cell): method __init__ (line 77) | def __init__(self, method set_train_local (line 109) | def set_train_local(self, config, training=True): method num_inputs (line 127) | def num_inputs(self): method init_weights (line 130) | def init_weights(self): method log2 (line 133) | def log2(self, value): method build_roi_layers (line 136) | def build_roi_layers(self, featmap_strides): method _c_map_roi_levels (line 145) | def _c_map_roi_levels(self, rois): method construct (line 170) | def construct(self, rois, feat1, feat2, feat3, feat4): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/FasterRcnn/rpn.py class RpnRegClsBlock (line 30) | class RpnRegClsBlock(nn.Cell): method __init__ (line 49) | def __init__(self, method construct (line 70) | def construct(self, x): class RPN (line 79) | class RPN(nn.Cell): method __init__ (line 98) | def __init__(self, method _make_rpn_layer (line 153) | def _make_rpn_layer(self, num_layers, in_channels, feat_channels, num_... method construct (line 200) | def construct(self, inputs, img_metas, anchor_list, gt_bboxes, gt_labe... FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/dataset.py function bbox_overlaps (line 34) | def bbox_overlaps(bboxes1, bboxes2, mode='iou'): class PhotoMetricDistortion (line 80) | class PhotoMetricDistortion: method __init__ (line 83) | def __init__(self, method __call__ (line 93) | def __call__(self, img, boxes, labels): class Expand (line 142) | class Expand: method __init__ (line 145) | def __init__(self, mean=(0, 0, 0), to_rgb=True, ratio_range=(1, 4)): method __call__ (line 152) | def __call__(self, img, boxes, labels): function rescale_column (line 168) | def rescale_column(img, img_shape, gt_bboxes, gt_label, gt_num): function resize_column (line 184) | def resize_column(img, img_shape, gt_bboxes, gt_label, gt_num): function resize_column_test (line 202) | def resize_column_test(img, img_shape, gt_bboxes, gt_label, gt_num): function impad_to_multiple_column (line 220) | def impad_to_multiple_column(img, img_shape, gt_bboxes, gt_label, gt_num): function imnormalize_column (line 227) | def imnormalize_column(img, img_shape, gt_bboxes, gt_label, gt_num): function flip_column (line 234) | def flip_column(img, img_shape, gt_bboxes, gt_label, gt_num): function flipped_generation (line 247) | def flipped_generation(img, img_shape, gt_bboxes, gt_label, gt_num): function image_bgr_rgb (line 259) | def image_bgr_rgb(img, img_shape, gt_bboxes, gt_label, gt_num): function transpose_column (line 264) | def transpose_column(img, img_shape, gt_bboxes, gt_label, gt_num): function photo_crop_column (line 276) | def photo_crop_column(img, img_shape, gt_bboxes, gt_label, gt_num): function expand_column (line 284) | def expand_column(img, img_shape, gt_bboxes, gt_label, gt_num): function preprocess_fn (line 292) | def preprocess_fn(image, box, is_training): function create_coco_label (line 344) | def create_coco_label(is_training): function anno_parser (line 395) | def anno_parser(annos_str): function filter_valid_data (line 404) | def filter_valid_data(image_dir, anno_path): function data_to_mindrecord_byte_image (line 426) | def data_to_mindrecord_byte_image(dataset="coco", is_training=True, pref... function create_fasterrcnn_dataset (line 451) | def create_fasterrcnn_dataset(mindrecord_file, batch_size=2, repeat_num=... FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/lr_schedule.py function linear_warmup_learning_rate (line 18) | def linear_warmup_learning_rate(current_step, warmup_steps, base_lr, ini... function a_cosine_learning_rate (line 23) | def a_cosine_learning_rate(current_step, base_lr, warmup_steps, decay_st... function dynamic_lr (line 28) | def dynamic_lr(config, rank_size=1): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/network_define.py class LossCallBack (line 32) | class LossCallBack(Callback): method __init__ (line 45) | def __init__(self, per_print_times=1, rank_id=0): method step_end (line 64) | def step_end(self, run_context): class LossNet (line 115) | class LossNet(nn.Cell): method construct (line 117) | def construct(self, x1, x2, x3, x4, x5, x6): class WithLossCell (line 120) | class WithLossCell(nn.Cell): method __init__ (line 128) | def __init__(self, backbone, loss_fn): method construct (line 133) | def construct(self, x, img_shape, gt_bboxe, gt_label, gt_num): method backbone_network (line 138) | def backbone_network(self): class TrainOneStepCell (line 148) | class TrainOneStepCell(nn.Cell): method __init__ (line 164) | def __init__(self, network, network_backbone, optimizer, sens=1.0, red... method construct (line 178) | def construct(self, x, img_shape, gt_bboxe, gt_label, gt_num): FILE: examples/model_security/model_attacks/cv/faster_rcnn/src/util.py function coco_eval (line 41) | def coco_eval(result_files, result_types, coco, max_dets=(100, 300, 1000... function xyxy2xywh (line 108) | def xyxy2xywh(bbox): function bbox2result_1image (line 117) | def bbox2result_1image(bboxes, labels, num_classes): function proposal2json (line 134) | def proposal2json(dataset, results): function det2json (line 151) | def det2json(dataset, results): function segm2json (line 172) | def segm2json(dataset, results): function results2json (line 206) | def results2json(dataset, results, out_file): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/coco_attack_deepfool.py function parse_args (line 37) | def parse_args(): function conver_testing_shape (line 56) | def conver_testing_shape(args): class SolveOutput (line 62) | class SolveOutput(Cell): method __init__ (line 64) | def __init__(self, network): method construct (line 69) | def construct(self, image, input_shape): function test (line 78) | def test(): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/config.py class ConfigYOLOV3DarkNet53 (line 18) | class ConfigYOLOV3DarkNet53: FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/convert_weight.py function load_weight (line 24) | def load_weight(weights_file): function build_network (line 33) | def build_network(): function convert (line 41) | def convert(weights_file, output_file): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/darknet.py function conv_block (line 22) | def conv_block(in_channels, class ResidualBlock (line 44) | class ResidualBlock(nn.Cell): method __init__ (line 59) | def __init__(self, method construct (line 69) | def construct(self, x): class DarkNet (line 78) | class DarkNet(nn.Cell): method __init__ (line 99) | def __init__(self, method _make_layer (line 157) | def _make_layer(self, block, layer_num, in_channel, out_channel): method construct (line 179) | def construct(self, x): method get_out_channels (line 196) | def get_out_channels(self): function darknet53 (line 200) | def darknet53(): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/distributed_sampler.py class DistributedSampler (line 21) | class DistributedSampler: method __init__ (line 23) | def __init__(self, dataset_size, num_replicas=None, rank=None, shuffle... method __iter__ (line 38) | def __iter__(self): method __len__ (line 59) | def __len__(self): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/initializer.py function calculate_gain (line 25) | def calculate_gain(nonlinearity, param=None): function _assignment (line 67) | def _assignment(arr, num): function _calculate_correct_fan (line 81) | def _calculate_correct_fan(array, mode): function kaiming_uniform_ (line 91) | def kaiming_uniform_(arr, a=0, mode='fan_in', nonlinearity='leaky_relu'): function _calculate_fan_in_and_fan_out (line 125) | def _calculate_fan_in_and_fan_out(arr): class KaimingUniform (line 142) | class KaimingUniform(MeInitializer): method __init__ (line 144) | def __init__(self, a=0, mode='fan_in', nonlinearity='leaky_relu'): method _initialize (line 150) | def _initialize(self, arr): function default_recurisive_init (line 155) | def default_recurisive_init(custom_cell): function load_yolov3_params (line 181) | def load_yolov3_params(args, network): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/logger.py class LOGGER (line 22) | class LOGGER(logging.Logger): method __init__ (line 30) | def __init__(self, logger_name, rank=0): method setup_logging_file (line 40) | def setup_logging_file(self, log_dir, rank=0): method info (line 53) | def info(self, msg, *args, **kwargs): method save_args (line 57) | def save_args(self, args): function get_logger (line 65) | def get_logger(path, rank): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/loss.py class XYLoss (line 20) | class XYLoss(nn.Cell): method __init__ (line 22) | def __init__(self): method construct (line 27) | def construct(self, object_mask, box_loss_scale, predict_xy, true_xy): class WHLoss (line 33) | class WHLoss(nn.Cell): method __init__ (line 35) | def __init__(self): method construct (line 40) | def construct(self, object_mask, box_loss_scale, predict_wh, true_wh): class ConfidenceLoss (line 46) | class ConfidenceLoss(nn.Cell): method __init__ (line 48) | def __init__(self): method construct (line 53) | def construct(self, object_mask, predict_confidence, ignore_mask): class ClassLoss (line 60) | class ClassLoss(nn.Cell): method __init__ (line 62) | def __init__(self): method construct (line 67) | def construct(self, object_mask, predict_class, class_probs): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/lr_scheduler.py function linear_warmup_lr (line 24) | def linear_warmup_lr(current_step, warmup_steps, base_lr, init_lr): function warmup_step_lr (line 31) | def warmup_step_lr(lr, lr_epochs, steps_per_epoch, warmup_epochs, max_ep... function multi_step_lr (line 56) | def multi_step_lr(lr, milestones, steps_per_epoch, max_epoch, gamma=0.1): function step_lr (line 60) | def step_lr(lr, epoch_size, steps_per_epoch, max_epoch, gamma=0.1): function warmup_cosine_annealing_lr (line 68) | def warmup_cosine_annealing_lr(lr, steps_per_epoch, warmup_epochs, max_e... function warmup_cosine_annealing_lr_V2 (line 87) | def warmup_cosine_annealing_lr_V2(lr, steps_per_epoch, warmup_epochs, ma... function warmup_cosine_annealing_lr_sample (line 118) | def warmup_cosine_annealing_lr_sample(lr, steps_per_epoch, warmup_epochs... function get_lr (line 149) | def get_lr(args): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/transforms.py function _rand (line 27) | def _rand(a=0., b=1.): function bbox_iou (line 31) | def bbox_iou(bbox_a, bbox_b, offset=0): function statistic_normalize_img (line 64) | def statistic_normalize_img(img, statistic_norm): function get_interp_method (line 77) | def get_interp_method(interp, sizes=()): function pil_image_reshape (line 125) | def pil_image_reshape(interp): function _preprocess_true_boxes (line 137) | def _preprocess_true_boxes(true_boxes, anchors, in_shape, num_classes, function _reshape_data (line 224) | def _reshape_data(image, image_size): function color_distortion (line 242) | def color_distortion(img, hue, sat, val, device_num): function filp_pil_image (line 264) | def filp_pil_image(img): function convert_gray_to_color (line 268) | def convert_gray_to_color(img): function _is_iou_satisfied_constraint (line 275) | def _is_iou_satisfied_constraint(min_iou, max_iou, box, crop_box): function _choose_candidate_by_constraints (line 280) | def _choose_candidate_by_constraints(max_trial, input_w, input_h, image_... function _correct_bbox_by_candidates (line 332) | def _correct_bbox_by_candidates(candidates, input_w, input_h, image_w, function _data_aug (line 372) | def _data_aug(image, box, jitter, hue, sat, val, image_input_size, max_b... function preprocess_fn (line 435) | def preprocess_fn(image, box, config, input_size, device_num): function reshape_fn (line 451) | def reshape_fn(image, img_id, config): class MultiScaleTrans (line 457) | class MultiScaleTrans: method __init__ (line 459) | def __init__(self, config, device_num): method generate_seed_list (line 476) | def generate_seed_list(self, init_seed=1234, seed_num=int(1e6), seed_r... method __call__ (line 484) | def __call__(self, imgs, annos, x1, x2, x3, x4, x5, x6, batchInfo): function thread_batch_preprocess_true_box (line 523) | def thread_batch_preprocess_true_box(annos, config, input_shape, result_... function batch_preprocess_true_box (line 541) | def batch_preprocess_true_box(annos, config, input_shape): function batch_preprocess_true_box_single (line 574) | def batch_preprocess_true_box_single(annos, config, input_shape): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/util.py class AverageMeter (line 23) | class AverageMeter: method __init__ (line 26) | def __init__(self, name, fmt=':f', tb_writer=None): method reset (line 37) | def reset(self): method update (line 43) | def update(self, val, n=1): method __str__ (line 52) | def __str__(self): function load_backbone (line 57) | def load_backbone(net, ckpt_path, args): function default_wd_filter (line 116) | def default_wd_filter(x): function get_param_groups (line 132) | def get_param_groups(network): class ShapeRecord (line 153) | class ShapeRecord: method __init__ (line 155) | def __init__(self): method set (line 170) | def set(self, shape): method show (line 177) | def show(self, logger): function keep_loss_fp32 (line 183) | def keep_loss_fp32(network): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/yolo.py function _conv_bn_relu (line 34) | def _conv_bn_relu(in_channel, class YoloBlock (line 58) | class YoloBlock(nn.Cell): method __init__ (line 74) | def __init__(self, in_channels, out_chls, out_channels): method construct (line 89) | def construct(self, x): class YOLOv3 (line 103) | class YOLOv3(nn.Cell): method __init__ (line 123) | def __init__(self, backbone_shape, backbone, out_channel): method construct (line 140) | def construct(self, x): class DetectionBlock (line 163) | class DetectionBlock(nn.Cell): method __init__ (line 179) | def __init__(self, scale, config=ConfigYOLOV3DarkNet53(), is_training=... method construct (line 201) | def construct(self, x, input_shape): class Iou (line 242) | class Iou(nn.Cell): method __init__ (line 244) | def __init__(self): method construct (line 249) | def construct(self, box1, box2): class YoloLossBlock (line 276) | class YoloLossBlock(nn.Cell): method __init__ (line 280) | def __init__(self, scale, config=ConfigYOLOV3DarkNet53()): method construct (line 302) | def construct(self, grid, prediction, pred_xy, pred_wh, y_true, gt_box... class YOLOV3DarkNet53 (line 353) | class YOLOV3DarkNet53(nn.Cell): method __init__ (line 367) | def __init__(self, is_training): method construct (line 384) | def construct(self, x, input_shape): class YoloWithLossCell (line 393) | class YoloWithLossCell(nn.Cell): method __init__ (line 395) | def __init__(self, network): method construct (line 403) | def construct(self, x, y_true_0, y_true_1, y_true_2, gt_0, gt_1, gt_2,... class TrainingWrapper (line 411) | class TrainingWrapper(nn.Cell): method __init__ (line 413) | def __init__(self, network, optimizer, sens=1.0): method construct (line 434) | def construct(self, *args): FILE: examples/model_security/model_attacks/cv/yolov3_darknet53/src/yolo_dataset.py function _has_only_empty_bbox (line 34) | def _has_only_empty_bbox(anno): function _count_visible_keypoints (line 38) | def _count_visible_keypoints(anno): function has_valid_annotation (line 42) | def has_valid_annotation(anno): class COCOYoloDataset (line 61) | class COCOYoloDataset: method __init__ (line 63) | def __init__(self, root, ann_file, remove_images_without_annotations=T... method __getitem__ (line 90) | def __getitem__(self, index): method __len__ (line 135) | def __len__(self): method _convetTopDown (line 138) | def _convetTopDown(self, bbox): function create_yolo_dataset (line 146) | def create_yolo_dataset(image_dir, anno_path, batch_size, max_epoch, dev... FILE: examples/model_security/model_attacks/white_box/mnist_attack_cw.py function test_carlini_wagner_attack (line 35) | def test_carlini_wagner_attack(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_deepfool.py function test_deepfool_attack (line 35) | def test_deepfool_attack(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_fgsm.py function test_fast_gradient_sign_method (line 36) | def test_fast_gradient_sign_method(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_jsma.py function test_jsma_attack (line 35) | def test_jsma_attack(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_lbfgs.py function test_lbfgs_attack (line 36) | def test_lbfgs_attack(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_mdi2fgsm.py function test_momentum_diverse_input_iterative_method (line 36) | def test_momentum_diverse_input_iterative_method(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_pgd.py function test_projected_gradient_descent_method (line 36) | def test_projected_gradient_descent_method(): FILE: examples/model_security/model_attacks/white_box/mnist_attack_vmifgsm.py function test_variance_tuning_momentum_iterative_method (line 35) | def test_variance_tuning_momentum_iterative_method(): FILE: examples/model_security/model_defenses/mnist_defense_nad.py function test_nad_method (line 37) | def test_nad_method(): FILE: examples/model_security/model_defenses/mnist_evaluation.py function get_detector (line 46) | def get_detector(train_images): class EncoderNet (line 53) | class EncoderNet(Cell): method __init__ (line 58) | def __init__(self, encode_dim): method construct (line 63) | def construct(self, inputs): method get_encode_dim (line 73) | def get_encode_dim(self): class ModelToBeAttacked (line 83) | class ModelToBeAttacked(BlackModel): method __init__ (line 88) | def __init__(self, network, defense=False, train_images=None): method predict (line 98) | def predict(self, inputs): method get_detected_result (line 127) | def get_detected_result(self): function test_defense_evaluation (line 131) | def test_defense_evaluation(): FILE: examples/model_security/model_defenses/mnist_similarity_detector.py class ModelToBeAttacked (line 37) | class ModelToBeAttacked(BlackModel): method __init__ (line 42) | def __init__(self, network): method predict (line 47) | def predict(self, inputs): method get_queries (line 63) | def get_queries(self): class EncoderNet (line 67) | class EncoderNet(Cell): method __init__ (line 72) | def __init__(self, encode_dim): method construct (line 77) | def construct(self, inputs): method get_encode_dim (line 87) | def get_encode_dim(self): function test_similarity_detector (line 97) | def test_similarity_detector(): FILE: examples/model_security/neuron_sensitivity/mnist_neuron_sensitivity.py function test_neuron_sensitivity (line 41) | def test_neuron_sensitivity(): FILE: examples/natural_robustness/natural_robustness_example.py function test_perspective (line 24) | def test_perspective(image): function test_uniform_noise (line 34) | def test_uniform_noise(image): function test_gaussian_noise (line 42) | def test_gaussian_noise(image): function test_contrast (line 50) | def test_contrast(image): function test_gaussian_blur (line 58) | def test_gaussian_blur(image): function test_salt_and_pepper_noise (line 66) | def test_salt_and_pepper_noise(image): function test_translate (line 74) | def test_translate(image): function test_scale (line 82) | def test_scale(image): function test_shear (line 90) | def test_shear(image): function test_rotate (line 98) | def test_rotate(image): function test_curve (line 106) | def test_curve(image): function test_natural_noise (line 114) | def test_natural_noise(image): function test_gradient_luminance (line 122) | def test_gradient_luminance(image): function test_motion_blur (line 137) | def test_motion_blur(image): function test_gradient_blur (line 147) | def test_gradient_blur(image): FILE: examples/natural_robustness/serving/client/serving_client.py function perturb (line 28) | def perturb(perturb_config, address): FILE: examples/natural_robustness/serving/server/perturbation/servable_config.py function check_inputs (line 45) | def check_inputs(img, perturb_config, methods_number, outputs_number): function perturb (line 71) | def perturb(img, perturb_config, methods_number, outputs_number): function natural_perturbation (line 105) | def natural_perturbation(img, perturb_config, methods_number, outputs_nu... FILE: examples/natural_robustness/serving/server/serving_server.py function start (line 22) | def start(address): FILE: examples/privacy/diff_privacy/lenet5_dp.py function generate_mnist_dataset (line 44) | def generate_mnist_dataset(data_path, batch_size=32, repeat_size=1, FILE: examples/privacy/diff_privacy/lenet5_dp_ada_gaussian.py function generate_mnist_dataset (line 44) | def generate_mnist_dataset(data_path, batch_size=32, repeat_size=1, FILE: examples/privacy/diff_privacy/lenet5_dp_ada_sgd_graph.py function generate_mnist_dataset (line 44) | def generate_mnist_dataset(data_path, batch_size=32, repeat_size=1, FILE: examples/privacy/diff_privacy/lenet5_dp_optimizer.py function generate_mnist_dataset (line 45) | def generate_mnist_dataset(data_path, batch_size=32, repeat_size=1, FILE: examples/privacy/inversion_attack/cifar_black_box.py function cifar_inversion_attack (line 39) | def cifar_inversion_attack(net, inv_net, ckptpath): FILE: examples/privacy/inversion_attack/cifar_shadow_attack.py function cifar_inversion_attack (line 37) | def cifar_inversion_attack(net, shadow_net, ckptpath): FILE: examples/privacy/inversion_attack/inversion_net.py class LeNetDecoderConv1 (line 7) | class LeNetDecoderConv1(nn.Cell): method __init__ (line 11) | def __init__(self): method construct (line 20) | def construct(self, x): class LeNetDecoderReLU2 (line 24) | class LeNetDecoderReLU2(nn.Cell): method __init__ (line 28) | def __init__(self): method construct (line 49) | def construct(self, x): class CIFAR10CNNDecoderConv11 (line 56) | class CIFAR10CNNDecoderConv11(nn.Cell): method __init__ (line 60) | def __init__(self): method construct (line 70) | def construct(self, x): class CIFAR10CNNDecoderReLU22 (line 75) | class CIFAR10CNNDecoderReLU22(nn.Cell): method __init__ (line 79) | def __init__(self): method construct (line 99) | def construct(self, x): class CIFAR10CNNDecoderReLU32 (line 106) | class CIFAR10CNNDecoderReLU32(nn.Cell): method __init__ (line 110) | def __init__(self): method construct (line 140) | def construct(self, x): FILE: examples/privacy/inversion_attack/mnist_inversion_attack.py class LeNet5_part (line 36) | class LeNet5_part(nn.Cell): method __init__ (line 40) | def __init__(self): method construct (line 51) | def construct(self, x): function mnist_inversion_attack (line 61) | def mnist_inversion_attack(net): FILE: examples/privacy/inversion_attack/shadow_net.py class LeNetAlternativeConv1 (line 8) | class LeNetAlternativeConv1(nn.Cell): method __init__ (line 12) | def __init__(self): method construct (line 34) | def construct(self, x): class LeNetAlternativeConv1Arch2 (line 40) | class LeNetAlternativeConv1Arch2(nn.Cell): method __init__ (line 44) | def __init__(self): method construct (line 66) | def construct(self, x): class LeNetAlternativeReLU1 (line 72) | class LeNetAlternativeReLU1(nn.Cell): method __init__ (line 76) | def __init__(self): method construct (line 94) | def construct(self, x): class LeNetAlternativePool1 (line 100) | class LeNetAlternativePool1(nn.Cell): method __init__ (line 104) | def __init__(self): method construct (line 126) | def construct(self, x): class LeNetAlternativeConv2 (line 132) | class LeNetAlternativeConv2(nn.Cell): method __init__ (line 136) | def __init__(self): method construct (line 166) | def construct(self, x): class LeNetAlternativeReLU2 (line 172) | class LeNetAlternativeReLU2(nn.Cell): method __init__ (line 176) | def __init__(self): method construct (line 210) | def construct(self, x): class LeNetAlternativePool2 (line 216) | class LeNetAlternativePool2(nn.Cell): method __init__ (line 220) | def __init__(self): method construct (line 258) | def construct(self, x): class LeNetAlternativeFc1 (line 264) | class LeNetAlternativeFc1(nn.Cell): method __init__ (line 268) | def __init__(self): method construct (line 311) | def construct(self, x): class LeNetAlternativeFc1Act (line 320) | class LeNetAlternativeFc1Act(nn.Cell): method __init__ (line 324) | def __init__(self): method construct (line 371) | def construct(self, x): class CIFAR10CNNAlternativeConv11 (line 380) | class CIFAR10CNNAlternativeConv11(nn.Cell): method __init__ (line 384) | def __init__(self): method construct (line 399) | def construct(self, x): method getlayeroutput (line 404) | def getlayeroutput(self, x, targetlayer): class CIFAR10CNNAlternativeConv11Arch2 (line 414) | class CIFAR10CNNAlternativeConv11Arch2(nn.Cell): method __init__ (line 418) | def __init__(self): method construct (line 443) | def construct(self, x): method getlayeroutput (line 448) | def getlayeroutput(self, x, targetlayer): class CIFAR10CNNAlternativeReLU22 (line 458) | class CIFAR10CNNAlternativeReLU22(nn.Cell): method __init__ (line 462) | def __init__(self): method construct (line 527) | def construct(self, x): method getlayeroutput (line 532) | def getlayeroutput(self, x, targetlayer): class CIFAR10CNNAlternativeReLU22Arch2 (line 542) | class CIFAR10CNNAlternativeReLU22Arch2(nn.Cell): method __init__ (line 546) | def __init__(self): method construct (line 579) | def construct(self, x): method getlayeroutput (line 584) | def getlayeroutput(self, x, targetlayer): class CIFAR10CNNAlternativeReLU32 (line 594) | class CIFAR10CNNAlternativeReLU32(nn.Cell): method __init__ (line 598) | def __init__(self): method construct (line 691) | def construct(self, x): method getlayeroutput (line 696) | def getlayeroutput(self, x, targetlayer): FILE: examples/privacy/membership_inference/eval.py class ParameterReduce (line 35) | class ParameterReduce(nn.Cell): method __init__ (line 37) | def __init__(self): method construct (line 42) | def construct(self, x): function parse_args (line 49) | def parse_args(cloud_args=None): function merge_args (line 88) | def merge_args(args, cloud_args): function test (line 102) | def test(cloud_args=None): FILE: examples/privacy/membership_inference/train.py function parse_args (line 49) | def parse_args(cloud_args=None): function merge_args (line 105) | def merge_args(args_opt, cloud_args): FILE: examples/privacy/sup_privacy/sup_privacy.py function generate_mnist_dataset (line 46) | def generate_mnist_dataset(data_path, batch_size=32, repeat_size=1, samp... function mnist_suppress_train (line 87) | def mnist_suppress_train(epoch_size=10, start_epoch=3, lr=0.05, samples=... FILE: mindarmour/__init__.py function _mindspore_version_check (line 53) | def _mindspore_version_check(): FILE: mindarmour/adv_robustness/attacks/attack.py class Attack (line 31) | class Attack: method __init__ (line 36) | def __init__(self): method batch_generate (line 39) | def batch_generate(self, inputs, labels, batch_size=64): method generate (line 92) | def generate(self, inputs, labels): method _reduction (line 111) | def _reduction(x_ori, q_times, label, best_position, model, targeted_a... method _fast_reduction (line 157) | def _fast_reduction(self, x_ori, best_position, q_times, auxiliary_inp... method _detection_scores (line 201) | def _detection_scores(inputs, gt_boxes, gt_labels, model): FILE: mindarmour/adv_robustness/attacks/black/black_model.py class BlackModel (line 27) | class BlackModel: method __init__ (line 32) | def __init__(self): method predict (line 36) | def predict(self, inputs): method is_adversarial (line 53) | def is_adversarial(self, data, label, is_targeted): FILE: mindarmour/adv_robustness/attacks/black/genetic_attack.py class GeneticAttack (line 31) | class GeneticAttack(Attack): method __init__ (line 102) | def __init__(self, model, model_type='classification', targeted=True, ... method _mutation (line 143) | def _mutation(self, cur_pop, step_noise=0.01, prob=0.005): method _compute_next_generation (line 167) | def _compute_next_generation(self, cur_pop, fit_vals, x_ori): method _generate_classification (line 228) | def _generate_classification(self, inputs, labels): method _generate_detection (line 331) | def _generate_detection(self, inputs, labels): method generate (line 433) | def generate(self, inputs, labels): FILE: mindarmour/adv_robustness/attacks/black/hop_skip_jump_attack.py function _clip_image (line 31) | def _clip_image(image, clip_min, clip_max): class HopSkipJumpAttack (line 38) | class HopSkipJumpAttack(Attack): method __init__ (line 112) | def __init__(self, model, init_num_evals=100, max_num_evals=1000, method _generate_one (line 151) | def _generate_one(self, sample): method set_target_images (line 178) | def set_target_images(self, target_images): method generate (line 187) | def generate(self, inputs, labels): method _hsja (line 230) | def _hsja(self, sample, target_label, target_image, dim, theta): method _decision_function (line 342) | def _decision_function(self, images, original_label, target_label): method _compute_distance (line 362) | def _compute_distance(self, original_img, perturbation_img): method _approximate_gradient (line 372) | def _approximate_gradient(self, sample, num_evals, original_label, method _project (line 413) | def _project(self, original_image, perturbed_images, alphas): method _binary_search_batch (line 427) | def _binary_search_batch(self, original_image, perturbed_images, method _initialize (line 470) | def _initialize(self, sample, original_label, target_label): method _geometric_progression_for_stepsize (line 505) | def _geometric_progression_for_stepsize(self, perturbed, update, dist, method _select_delta (line 524) | def _select_delta(self, dist_post_update, current_iteration, dim, theta): FILE: mindarmour/adv_robustness/attacks/black/natural_evolutionary_strategy.py function _bound (line 31) | def _bound(image, epislon): class NES (line 37) | class NES(Attack): method __init__ (line 120) | def __init__(self, model, scene, max_queries=10000, top_k=-1, num_clas... method generate (line 154) | def generate(self, inputs, labels): method set_target_images (line 206) | def set_target_images(self, target_images): method _generate_one (line 215) | def _generate_one(self, origin_image, target_label, target_image): method _plateau_annealing (line 323) | def _plateau_annealing(self, last_loss): method _softmax_cross_entropy_with_logit (line 332) | def _softmax_cross_entropy_with_logit(self, logit): method _query_limit_loss (line 341) | def _query_limit_loss(self, eval_points, noise): method _partial_info_loss (line 350) | def _partial_info_loss(self, eval_points, noise): method _label_only_loss (line 363) | def _label_only_loss(self, origin_image, eval_points, noise): method _preds_in_top_k (line 384) | def _preds_in_top_k(self, target_class, prop_adv_): method _get_grad (line 394) | def _get_grad(self, origin_image, eval_points, noise): FILE: mindarmour/adv_robustness/attacks/black/pointwise_attack.py class PointWiseAttack (line 30) | class PointWiseAttack(Attack): method __init__ (line 81) | def __init__(self, model, max_iter=1000, search_iter=10, is_targeted=F... method generate (line 93) | def generate(self, inputs, labels): method _decision_optimize (line 141) | def _decision_optimize(self, unperturbed_img, input_label, perturbed_i... method _binary_search (line 237) | def _binary_search(self, perturbed_img, unperturbed_img, ite_ind, inpu... method _initialize_starting_point (line 268) | def _initialize_starting_point(self, inputs, labels): method _get_threthod (line 284) | def _get_threthod(self): FILE: mindarmour/adv_robustness/attacks/black/pso_attack.py class PSOAttack (line 31) | class PSOAttack(Attack): method __init__ (line 101) | def __init__(self, model, model_type='classification', targeted=False,... method _fitness (line 135) | def _fitness(self, confi_ori, confi_adv, x_ori, x_adv): method _confidence_cla (line 165) | def _confidence_cla(self, inputs, labels): method _mutation_op (line 185) | def _mutation_op(self, cur_pop): method _check_best_fitness (line 203) | def _check_best_fitness(self, best_fitness, iters): method _update_best_fit_position (line 211) | def _update_best_fit_position(self, fit_value, par_best_fit, par_best_... method _generate_classification (line 221) | def _generate_classification(self, inputs, labels): method _generate_detection (line 359) | def _generate_detection(self, inputs, labels): method generate (line 486) | def generate(self, inputs, labels): FILE: mindarmour/adv_robustness/attacks/black/salt_and_pepper_attack.py class SaltAndPepperNoiseAttack (line 30) | class SaltAndPepperNoiseAttack(Attack): method __init__ (line 75) | def __init__(self, model, bounds=(0.0, 1.0), max_iter=100, is_targeted... method generate (line 85) | def generate(self, inputs, labels): method _generate_one (line 120) | def _generate_one(self, one_input, label, epsilons=10): FILE: mindarmour/adv_robustness/attacks/carlini_wagner.py function _best_logits_of_other_class (line 33) | def _best_logits_of_other_class(logits, target_class, value=1): class CarliniWagnerL2Attack (line 59) | class CarliniWagnerL2Attack(Attack): method __init__ (line 117) | def __init__(self, network, num_classes, box_min=0.0, box_max=1.0, method _loss_function (line 142) | def _loss_function(self, logits, new_x, org_x, org_or_target_class, method _to_attack_space (line 210) | def _to_attack_space(self, inputs): method _to_model_space (line 232) | def _to_model_space(self, inputs): method _check_success (line 257) | def _check_success(self, logits, labels): method generate (line 265) | def generate(self, inputs, labels): method _update_bounds (line 354) | def _update_bounds(self, samples_num, adv_flag, const, upper_bound, lo... class _AdamOptimizer (line 371) | class _AdamOptimizer: method __init__ (line 382) | def __init__(self, shape): method __call__ (line 387) | def __call__(self, gradient, learning_rate=0.001, FILE: mindarmour/adv_robustness/attacks/deep_fool.py class _GetLogits (line 34) | class _GetLogits(Cell): method __init__ (line 35) | def __init__(self, network): method construct (line 39) | def construct(self, *inputs): function _deepfool_detection_scores (line 44) | def _deepfool_detection_scores(inputs, gt_boxes, gt_labels, network): function _is_success (line 88) | def _is_success(inputs, gt_boxes, gt_labels, network, gt_object_nums, re... class DeepFool (line 93) | class DeepFool(Attack): method __init__ (line 142) | def __init__(self, network, num_classes, model_type='classification', method generate (line 168) | def generate(self, inputs, labels): method _update_image (line 193) | def _update_image(self, x_origin, r_tot): method _generate_detection (line 203) | def _generate_detection(self, inputs, labels): method _generate_classification (line 265) | def _generate_classification(self, inputs, labels): method _normalize_r_i (line 323) | def _normalize_r_i(self, diff_w, weight): FILE: mindarmour/adv_robustness/attacks/gradient_method.py class GradientMethod (line 34) | class GradientMethod(Attack): method __init__ (line 50) | def __init__(self, network, eps=0.07, alpha=None, bounds=None, method generate (line 73) | def generate(self, inputs, labels): method _gradient (line 107) | def _gradient(self, inputs, labels): class FastGradientMethod (line 126) | class FastGradientMethod(GradientMethod): method __init__ (line 167) | def __init__(self, network, eps=0.07, alpha=None, bounds=(0.0, 1.0), method _gradient (line 178) | def _gradient(self, inputs, labels): class RandomFastGradientMethod (line 202) | class RandomFastGradientMethod(FastGradientMethod): method __init__ (line 247) | def __init__(self, network, eps=0.07, alpha=0.035, bounds=(0.0, 1.0), class FastGradientSignMethod (line 260) | class FastGradientSignMethod(GradientMethod): method __init__ (line 299) | def __init__(self, network, eps=0.07, alpha=None, bounds=(0.0, 1.0), method _gradient (line 308) | def _gradient(self, inputs, labels): class RandomFastGradientSignMethod (line 333) | class RandomFastGradientSignMethod(FastGradientSignMethod): method __init__ (line 376) | def __init__(self, network, eps=0.07, alpha=0.035, bounds=(0.0, 1.0), class LeastLikelyClassMethod (line 388) | class LeastLikelyClassMethod(FastGradientSignMethod): method __init__ (line 424) | def __init__(self, network, eps=0.07, alpha=None, bounds=(0.0, 1.0), class RandomLeastLikelyClassMethod (line 434) | class RandomLeastLikelyClassMethod(FastGradientSignMethod): method __init__ (line 475) | def __init__(self, network, eps=0.07, alpha=0.035, bounds=(0.0, 1.0), FILE: mindarmour/adv_robustness/attacks/iterative_gradient_method.py function _reshape_l1_projection (line 38) | def _reshape_l1_projection(values, eps=3): function _projection (line 75) | def _projection(values, eps, clip_diff, norm_level): class IterativeGradientMethod (line 108) | class IterativeGradientMethod(Attack): method __init__ (line 124) | def __init__(self, network, eps=0.3, eps_iter=0.1, bounds=(0.0, 1.0), ... method generate (line 142) | def generate(self, inputs, labels): class BasicIterativeMethod (line 162) | class BasicIterativeMethod(IterativeGradientMethod): method __init__ (line 202) | def __init__(self, network, eps=0.3, eps_iter=0.1, bounds=(0.0, 1.0), method generate (line 217) | def generate(self, inputs, labels): class MomentumIterativeMethod (line 261) | class MomentumIterativeMethod(IterativeGradientMethod): method __init__ (line 307) | def __init__(self, network, eps=0.3, eps_iter=0.1, bounds=(0.0, 1.0), method generate (line 320) | def generate(self, inputs, labels): method _gradient (line 375) | def _gradient(self, inputs, labels): class ProjectedGradientDescent (line 404) | class ProjectedGradientDescent(BasicIterativeMethod): method __init__ (line 450) | def __init__(self, network, eps=0.3, eps_iter=0.1, bounds=(0.0, 1.0), method generate (line 461) | def generate(self, inputs, labels): class AutoProjectedGradientDescent (line 502) | class AutoProjectedGradientDescent(BasicIterativeMethod): method __init__ (line 554) | def __init__(self, network, eps=8 / 255, eps_iter=0.1, bounds=(0.0, 1.... method generate (line 567) | def generate(self, inputs, labels): method _optimize_attack (line 633) | def _optimize_attack(self, x_adv, x_best, x_best_adv, x_adv_old, momen... method _check_oscillation (line 701) | def _check_oscillation(self, x, j, k, k3=0.75): class DiverseInputIterativeMethod (line 713) | class DiverseInputIterativeMethod(BasicIterativeMethod): method __init__ (line 752) | def __init__(self, network, eps=0.3, bounds=(0.0, 1.0), class MomentumDiverseInputIterativeMethod (line 767) | class MomentumDiverseInputIterativeMethod(MomentumIterativeMethod): method __init__ (line 809) | def __init__(self, network, eps=0.3, bounds=(0.0, 1.0), function _transform_inputs (line 824) | def _transform_inputs(inputs, prob, low=29, high=33, full_aug=False): class VarianceTuningMomentumIterativeMethod (line 866) | class VarianceTuningMomentumIterativeMethod(MomentumIterativeMethod): method __init__ (line 912) | def __init__(self, network, eps=0.3, eps_iter=0.1, bounds=(0.0, 1.0), method generate (line 927) | def generate(self, inputs, labels): class VarianceTuningNesterovIterativeMethod (line 972) | class VarianceTuningNesterovIterativeMethod(MomentumIterativeMethod): method __init__ (line 1023) | def __init__(self, network, eps=8/255, eps_iter=2/255, bounds=(0.0, 1.0), method generate (line 1038) | def generate(self, inputs, labels): FILE: mindarmour/adv_robustness/attacks/jsma.py class JSMAAttack (line 33) | class JSMAAttack(Attack): method __init__ (line 76) | def __init__(self, network, num_classes, box_min=0.0, box_max=1.0, method _saliency_map (line 94) | def _saliency_map(self, data, bit_map, target): method _generate_one (line 136) | def _generate_one(self, data, target): method generate (line 187) | def generate(self, inputs, labels): FILE: mindarmour/adv_robustness/attacks/lbfgs.py class LBFGS (line 35) | class LBFGS(Attack): method __init__ (line 80) | def __init__(self, network, eps=1e-5, bounds=(0.0, 1.0), is_targeted=T... method generate (line 105) | def generate(self, inputs, labels): method _forward_one (line 126) | def _forward_one(self, cur_input): method _gradient (line 132) | def _gradient(self, cur_input, labels, shape): method _loss (line 144) | def _loss(self, cur_input, start_input, cur_eps, shape, labels): method _lbfgsb (line 169) | def _lbfgsb(self, start_input, cur_eps, shape, labels, bounds): method _optimize (line 210) | def _optimize(self, start_input, labels, epsilon): FILE: mindarmour/adv_robustness/defenses/adversarial_defense.py class AdversarialDefense (line 29) | class AdversarialDefense(Defense): method __init__ (line 67) | def __init__(self, network, loss_fn=None, optimizer=None): method defense (line 83) | def defense(self, inputs, labels): class AdversarialDefenseWithAttacks (line 100) | class AdversarialDefenseWithAttacks(AdversarialDefense): method __init__ (line 152) | def __init__(self, network, attacks, loss_fn=None, optimizer=None, method defense (line 167) | def defense(self, inputs, labels): class EnsembleAdversarialDefense (line 199) | class EnsembleAdversarialDefense(AdversarialDefenseWithAttacks): method __init__ (line 251) | def __init__(self, network, attacks, loss_fn=None, optimizer=None, FILE: mindarmour/adv_robustness/defenses/defense.py class Defense (line 27) | class Defense: method __init__ (line 36) | def __init__(self, network): method defense (line 40) | def defense(self, inputs, labels): method batch_defense (line 57) | def batch_defense(self, inputs, labels, batch_size=32, epochs=5): FILE: mindarmour/adv_robustness/defenses/natural_adversarial_defense.py class NaturalAdversarialDefense (line 21) | class NaturalAdversarialDefense(AdversarialDefenseWithAttacks): method __init__ (line 66) | def __init__(self, network, loss_fn=None, optimizer=None, FILE: mindarmour/adv_robustness/defenses/projected_adversarial_defense.py class ProjectedAdversarialDefense (line 21) | class ProjectedAdversarialDefense(AdversarialDefenseWithAttacks): method __init__ (line 72) | def __init__(self, FILE: mindarmour/adv_robustness/detectors/black/similarity_detector.py function _pairwise_distances (line 33) | def _pairwise_distances(x_input, y_input): class SimilarityDetector (line 53) | class SimilarityDetector(Detector): method __init__ (line 104) | def __init__(self, trans_model, max_k_neighbor=1000, chunk_size=1000, method fit (line 123) | def fit(self, inputs, labels=None): method detect (line 179) | def detect(self, inputs): method _process_query (line 202) | def _process_query(self, query): method clear_buffer (line 233) | def clear_buffer(self): method set_threshold (line 240) | def set_threshold(self, num_of_neighbors, threshold): method get_detection_interval (line 252) | def get_detection_interval(self): method get_detected_queries (line 265) | def get_detected_queries(self): method detect_diff (line 275) | def detect_diff(self, inputs): method transform (line 293) | def transform(self, inputs): FILE: mindarmour/adv_robustness/detectors/detector.py class Detector (line 25) | class Detector: method __init__ (line 29) | def __init__(self): method fit (line 34) | def fit(self, inputs, labels=None): method detect (line 53) | def detect(self, inputs): method detect_diff (line 70) | def detect_diff(self, inputs): method transform (line 88) | def transform(self, inputs): FILE: mindarmour/adv_robustness/detectors/ensemble_detector.py class EnsembleDetector (line 28) | class EnsembleDetector(Detector): method __init__ (line 69) | def __init__(self, detectors, policy="vote"): method fit (line 76) | def fit(self, inputs, labels=None): method detect (line 93) | def detect(self, inputs): method detect_diff (line 129) | def detect_diff(self, inputs): method transform (line 145) | def transform(self, inputs): FILE: mindarmour/adv_robustness/detectors/mag_net.py class ErrorBasedDetector (line 34) | class ErrorBasedDetector(Detector): method __init__ (line 69) | def __init__(self, auto_encoder, false_positive_rate=0.01, method fit (line 81) | def fit(self, inputs, labels=None): method detect (line 101) | def detect(self, inputs): method detect_diff (line 120) | def detect_diff(self, inputs): method transform (line 137) | def transform(self, inputs): method set_threshold (line 154) | def set_threshold(self, threshold): class DivergenceBasedDetector (line 164) | class DivergenceBasedDetector(ErrorBasedDetector): method __init__ (line 214) | def __init__(self, auto_encoder, model, option="jsd", method detect_diff (line 227) | def detect_diff(self, inputs): function _jsd (line 260) | def _jsd(prob_dist_p, prob_dist_q): FILE: mindarmour/adv_robustness/detectors/region_based_detector.py class RegionBasedDetector (line 35) | class RegionBasedDetector(Detector): method __init__ (line 79) | def __init__(self, model, number_points=10, initial_radius=0.0, method set_radius (line 94) | def set_radius(self, radius): method fit (line 105) | def fit(self, inputs, labels=None): method _generate_hyper_cube (line 151) | def _generate_hyper_cube(self, inputs, radius): method _rc_forward (line 169) | def _rc_forward(self, inputs, radius): method detect (line 197) | def detect(self, inputs): method detect_diff (line 225) | def detect_diff(self, inputs): method transform (line 243) | def transform(self, inputs): FILE: mindarmour/adv_robustness/detectors/spatial_smoothing.py function _median_filter_np (line 33) | def _median_filter_np(inputs, size=2): class SpatialSmoothing (line 38) | class SpatialSmoothing(Detector): method __init__ (line 77) | def __init__(self, model, ksize=3, is_local_smooth=True, method fit (line 91) | def fit(self, inputs, labels=None): method detect (line 115) | def detect(self, inputs): method detect_diff (line 138) | def detect_diff(self, inputs): method transform (line 155) | def transform(self, inputs): method set_threshold (line 159) | def set_threshold(self, threshold): method _dist (line 168) | def _dist(self, before, after): FILE: mindarmour/adv_robustness/evaluations/attack_evaluation.py class AttackEvaluate (line 29) | class AttackEvaluate: method __init__ (line 69) | def __init__(self, inputs, labels, adv_inputs, adv_preds, method mis_classification_rate (line 101) | def mis_classification_rate(self): method avg_conf_adv_class (line 110) | def avg_conf_adv_class(self): method avg_conf_true_class (line 125) | def avg_conf_true_class(self): method avg_lp_distance (line 138) | def avg_lp_distance(self): method avg_ssim (line 167) | def avg_ssim(self): method nte (line 189) | def nte(self): FILE: mindarmour/adv_robustness/evaluations/black/defense_evaluation.py class BlackDefenseEvaluate (line 27) | class BlackDefenseEvaluate: method __init__ (line 89) | def __init__(self, raw_preds, def_preds, raw_query_counts, def_query_c... method qcv (line 128) | def qcv(self): method asv (line 152) | def asv(self): method fpr (line 172) | def fpr(self): method qrv (line 188) | def qrv(self): FILE: mindarmour/adv_robustness/evaluations/defense_evaluation.py class DefenseEvaluate (line 29) | class DefenseEvaluate: method __init__ (line 59) | def __init__(self, raw_preds, def_preds, true_labels): method cav (line 67) | def cav(self): method crr (line 81) | def crr(self): method csr (line 94) | def csr(self): method ccv (line 107) | def ccv(self): method cos (line 130) | def cos(self): FILE: mindarmour/adv_robustness/evaluations/neuron_metrics.py class NeuronMetric (line 29) | class NeuronMetric: method __init__ (line 55) | def __init__(self, model, inputs, adv_inputs, hook_names): method neuron_sensitivity (line 85) | def neuron_sensitivity(self): FILE: mindarmour/adv_robustness/evaluations/visual_metrics.py class RadarMetric (line 31) | class RadarMetric: method __init__ (line 63) | def __init__(self, metrics_name, metrics_data, labels, title, scale='h... method show (line 93) | def show(self): FILE: mindarmour/fuzz_testing/fuzzing.py function _select_next (line 39) | def _select_next(initial_seeds): function _coverage_gains (line 47) | def _coverage_gains(pre_coverage, coverages): function _is_trans_valid (line 65) | def _is_trans_valid(seed, mutate_sample): function _gain_threshold (line 89) | def _gain_threshold(coverage): class Fuzzer (line 98) | class Fuzzer: method __init__ (line 181) | def __init__(self, target_model): method fuzzing (line 221) | def fuzzing(self, mutate_config, initial_seeds, coverage, evaluate=Tru... method _get_coverages_and_predict (line 340) | def _get_coverages_and_predict(self, mutate_samples, coverage): method _metamorphic_mutate (line 352) | def _metamorphic_mutate(self, seed, mutates, mutate_config, mutate_num... method _check_mutate_config (line 392) | def _check_mutate_config(self, mutate_config): method _check_attack_params (line 431) | def _check_attack_params(self, method, params): method _init_mutates (line 459) | def _init_mutates(self, mutate_config): method _evaluate (line 477) | def _evaluate(self, fuzz_samples, true_labels, fuzz_preds, fuzz_strate... class SensitivityMaximizingFuzzer (line 515) | class SensitivityMaximizingFuzzer(Fuzzer): method __init__ (line 599) | def __init__(self, target_model): method fuzzing (line 603) | def fuzzing(self, mutate_config, initial_seeds, method _get_coverages_and_predict (line 754) | def _get_coverages_and_predict(self, mutate_samples, coverage): method _evaluate (line 764) | def _evaluate(self, fuzz_samples, true_labels, fuzz_preds, fuzz_strate... FILE: mindarmour/fuzz_testing/model_coverage_metrics.py class CoverageMetrics (line 35) | class CoverageMetrics: method __init__ (line 54) | def __init__(self, model, incremental=False, batch_size=32): method get_metrics (line 61) | def get_metrics(self, dataset): method _init_neuron_activate_table (line 76) | def _init_neuron_activate_table(self, data): method _get_bounds (line 100) | def _get_bounds(self, train_dataset): method _activate_rate (line 135) | def _activate_rate(self): class NeuronCoverage (line 149) | class NeuronCoverage(CoverageMetrics): method __init__ (line 161) | def __init__(self, model, threshold=0.1, incremental=False, batch_size... method get_metrics (line 167) | def get_metrics(self, dataset): class TopKNeuronCoverage (line 241) | class TopKNeuronCoverage(CoverageMetrics): method __init__ (line 254) | def __init__(self, model, top_k=3, incremental=False, batch_size=32): method get_metrics (line 258) | def get_metrics(self, dataset): class SuperNeuronActivateCoverage (line 334) | class SuperNeuronActivateCoverage(CoverageMetrics): method __init__ (line 346) | def __init__(self, model, train_dataset, incremental=False, batch_size... method get_metrics (line 351) | def get_metrics(self, dataset): class NeuronBoundsCoverage (line 427) | class NeuronBoundsCoverage(SuperNeuronActivateCoverage): method __init__ (line 441) | def __init__(self, model, train_dataset, incremental=False, batch_size... method get_metrics (line 444) | def get_metrics(self, dataset): class KMultisectionNeuronCoverage (line 521) | class KMultisectionNeuronCoverage(SuperNeuronActivateCoverage): method __init__ (line 534) | def __init__(self, model, train_dataset, segmented_num=100, incrementa... method _init_k_multisection_table (line 542) | def _init_k_multisection_table(self, data): method get_metrics (line 552) | def get_metrics(self, dataset): FILE: mindarmour/fuzz_testing/sensitivity_convergence_coverage.py class SensitivityConvergenceCoverage (line 32) | class SensitivityConvergenceCoverage(CoverageMetrics): method __init__ (line 48) | def __init__(self, model, threshold=0.5, incremental=False, batch_size... method get_metrics (line 58) | def get_metrics(self, dataset): method _get_sensitive_neruon_idx (line 141) | def _get_sensitive_neruon_idx(self, dataset): method _scc (line 159) | def _scc(self, sensitivity_list, size, threshold=0): method _proposal (line 182) | def _proposal(self, x, stepsize): method _p_acc_mh (line 195) | def _p_acc_mh(self, x_new, x_old, log_prob): method _log_prob (line 207) | def _log_prob(self, x): method _sample_mh (line 217) | def _sample_mh(self, x_old, log_prob, stepsize): method _build_mh_chain (line 238) | def _build_mh_chain(self, init, stepsize, n_total, log_prob): FILE: mindarmour/model_protection/obfuscation.py function _check_dir_path (line 45) | def _check_dir_path(name, dir_path): function _check_ops_info (line 54) | def _check_ops_info(ops_info): function _check_new_input_info (line 71) | def _check_new_input_info(insert_new_input): function _check_obf_metadata_config (line 83) | def _check_obf_metadata_config(config): function _check_weight_obf_config (line 105) | def _check_weight_obf_config(config): function _check_network_obf_config (line 117) | def _check_network_obf_config(config): function _check_valid_obf_config (line 133) | def _check_valid_obf_config(obf_config, config_type): function _check_valid_obf_config (line 164) | def _check_valid_obf_config(obf_config): class ModelObfuscator (line 192) | class ModelObfuscator: method __init__ (line 213) | def __init__(self, obf_config, obfuscate_scale): method _gen_obfuscate_tensor (line 220) | def _gen_obfuscate_tensor(self, tensor_shape, tensor_type='rearrange'): method _get_real_name (line 233) | def _get_real_name(self, src_name, tag, substitute): method _gen_obf_metadata (line 241) | def _gen_obf_metadata(self, obf_metadata_config): method set_metadata (line 268) | def set_metadata(self, new_metadata): method set_save_metadata_mapping (line 274) | def set_save_metadata_mapping(self, new_mapping): method _obfuscate_params (line 277) | def _obfuscate_params(self, params, obf_metadata, obf_config, not_obfu... method _obfuscate_safetensor_files (line 374) | def _obfuscate_safetensor_files(self, src_path, saved_path='./'): method obfuscate_weight_files (line 395) | def obfuscate_weight_files(self, src_path, saved_path='./', file_forma... method _obfuscate_single_file (line 420) | def _obfuscate_single_file(self, src_file, obf_metadata, obf_config, s... FILE: mindarmour/natural_robustness/transform/image/blur.py class GaussianBlur (line 29) | class GaussianBlur(_NaturalPerturb): method __init__ (line 47) | def __init__(self, ksize=2, auto_param=False): method __call__ (line 56) | def __call__(self, image): class MotionBlur (line 73) | class MotionBlur(_NaturalPerturb): method __init__ (line 95) | def __init__(self, degree=5, angle=45, auto_param=False): method __call__ (line 106) | def __call__(self, image): class GradientBlur (line 130) | class GradientBlur(_NaturalPerturb): method __init__ (line 153) | def __init__(self, point, kernel_num=3, center=True, auto_param=False): method _auto_param (line 161) | def _auto_param(self, h, w): method __call__ (line 166) | def __call__(self, image): FILE: mindarmour/natural_robustness/transform/image/corruption.py class UniformNoise (line 29) | class UniformNoise(_NaturalPerturb): method __init__ (line 48) | def __init__(self, factor=0.1, auto_param=False): method __call__ (line 55) | def __call__(self, image): class GaussianNoise (line 76) | class GaussianNoise(_NaturalPerturb): method __init__ (line 95) | def __init__(self, factor=0.1, auto_param=False): method __call__ (line 102) | def __call__(self, image): class SaltAndPepperNoise (line 122) | class SaltAndPepperNoise(_NaturalPerturb): method __init__ (line 141) | def __init__(self, factor=0, auto_param=False): method __call__ (line 148) | def __call__(self, image): class NaturalNoise (line 170) | class NaturalNoise(_NaturalPerturb): method __init__ (line 193) | def __init__(self, ratio=0.0002, k_x_range=(1, 5), k_y_range=(3, 25), ... method __call__ (line 202) | def __call__(self, image): FILE: mindarmour/natural_robustness/transform/image/luminance.py class Contrast (line 30) | class Contrast(_NaturalPerturb): method __init__ (line 51) | def __init__(self, alpha=1, beta=0, auto_param=False): method __call__ (line 60) | def __call__(self, image): function _circle_gradient_mask (line 77) | def _circle_gradient_mask(img_src, color_start, color_end, scope=0.5, po... function _line_gradient_mask (line 135) | def _line_gradient_mask(image, start_pos=None, start_color=(0, 0, 0), en... class GradientLuminance (line 202) | class GradientLuminance(_NaturalPerturb): method __init__ (line 234) | def __init__(self, color_start=(0, 0, 0), color_end=(255, 255, 255), s... method _set_auto_param (line 258) | def _set_auto_param(self, w, h): method __call__ (line 267) | def __call__(self, image): FILE: mindarmour/natural_robustness/transform/image/natural_perturb.py function _chw_to_hwc (line 26) | def _chw_to_hwc(img): function _is_hwc (line 41) | def _is_hwc(img): function _is_chw (line 59) | def _is_chw(img): function _is_rgb (line 77) | def _is_rgb(img): function _is_normalized (line 95) | def _is_normalized(img): class _NaturalPerturb (line 114) | class _NaturalPerturb: method __init__ (line 119) | def __init__(self): method _check (line 122) | def _check(self, image): method _original_format (line 144) | def _original_format(self, image, chw, normalized, gray3dim): method __call__ (line 156) | def __call__(self, image): FILE: mindarmour/natural_robustness/transform/image/transformation.py class Translate (line 29) | class Translate(_NaturalPerturb): method __init__ (line 51) | def __init__(self, x_bias=0, y_bias=0, auto_param=False): method __call__ (line 59) | def __call__(self, image): class Scale (line 78) | class Scale(_NaturalPerturb): method __init__ (line 100) | def __init__(self, factor_x=1, factor_y=1, auto_param=False): method __call__ (line 109) | def __call__(self, image): class Shear (line 128) | class Shear(_NaturalPerturb): method __init__ (line 151) | def __init__(self, factor=0.2, direction='horizontal', auto_param=False): method __call__ (line 163) | def __call__(self, image): class Rotate (line 190) | class Rotate(_NaturalPerturb): method __init__ (line 209) | def __init__(self, angle=20, auto_param=False): method __call__ (line 216) | def __call__(self, image): class Perspective (line 246) | class Perspective(_NaturalPerturb): method __init__ (line 266) | def __init__(self, ori_pos, dst_pos, auto_param=False): method _set_auto_param (line 274) | def _set_auto_param(self, w, h): method __call__ (line 283) | def __call__(self, image): class Curve (line 304) | class Curve(_NaturalPerturb): method __init__ (line 326) | def __init__(self, curves=3, depth=10, mode='vertical', auto_param=Fal... method _set_auto_params (line 338) | def _set_auto_params(self, height, width): method __call__ (line 347) | def __call__(self, image): FILE: mindarmour/privacy/diff_privacy/mechanisms/mechanisms.py class ClipMechanismsFactory (line 36) | class ClipMechanismsFactory: method __init__ (line 46) | def __init__(self): method create (line 50) | def create(mech_name, decay_policy='Linear', learning_rate=0.001, class NoiseMechanismsFactory (line 98) | class NoiseMechanismsFactory: method __init__ (line 106) | def __init__(self): method create (line 110) | def create(mech_name, norm_bound=1.0, initial_noise_multiplier=1.0, se... class _Mechanisms (line 158) | class _Mechanisms(Cell): method construct (line 164) | def construct(self, gradients): class NoiseGaussianRandom (line 170) | class NoiseGaussianRandom(_Mechanisms): method __init__ (line 199) | def __init__(self, norm_bound=1.0, initial_noise_multiplier=1.0, seed=... method construct (line 215) | def construct(self, gradients): class NoiseAdaGaussianRandom (line 231) | class NoiseAdaGaussianRandom(NoiseGaussianRandom): method __init__ (line 265) | def __init__(self, norm_bound=1.0, initial_noise_multiplier=1.0, seed=... method construct (line 279) | def construct(self, gradients): class _MechanismsParamsUpdater (line 295) | class _MechanismsParamsUpdater(Cell): method __init__ (line 312) | def __init__(self, decay_policy, decay_rate, cur_noise_multiplier, ini... method construct (line 327) | def construct(self): class AdaClippingWithGaussianRandom (line 349) | class AdaClippingWithGaussianRandom(Cell): method __init__ (line 391) | def __init__(self, decay_policy='Linear', learning_rate=0.001, method construct (line 419) | def construct(self, empirical_fraction, norm_bound): FILE: mindarmour/privacy/diff_privacy/monitor/monitor.py class PrivacyMonitorFactory (line 28) | class PrivacyMonitorFactory: method __init__ (line 35) | def __init__(self): method create (line 39) | def create(policy, *args, **kwargs): class RDPMonitor (line 70) | class RDPMonitor(Callback): method __init__ (line 126) | def __init__(self, num_samples, batch_size, initial_noise_multiplier=1.5, method max_epoch_suggest (line 193) | def max_epoch_suggest(self): method step_end (line 228) | def step_end(self, run_context): method _compute_privacy_steps (line 258) | def _compute_privacy_steps(self, steps): method _compute_rdp (line 296) | def _compute_rdp(self, sample_rate, noise_stddev): method _compute_privacy_budget (line 312) | def _compute_privacy_budget(self, rdp): method _compute_delta (line 328) | def _compute_delta(self, rdp): method _compute_eps (line 344) | def _compute_eps(self, rdp): class ZCDPMonitor (line 360) | class ZCDPMonitor(Callback): method __init__ (line 409) | def __init__(self, num_samples, batch_size, initial_noise_multiplier=1.5, method max_epoch_suggest (line 445) | def max_epoch_suggest(self): method step_end (line 467) | def step_end(self, run_context): method _compute_privacy_steps (line 492) | def _compute_privacy_steps(self, steps): method _compute_zcdp (line 524) | def _compute_zcdp(self, noise_stddev): method _compute_eps (line 537) | def _compute_eps(self, zcdp): function _compute_rdp_with_order (line 552) | def _compute_rdp_with_order(sample_rate, noise_stddev, order): function _log_add (line 603) | def _log_add(x, y): function _log_subtract (line 614) | def _log_subtract(x, y): FILE: mindarmour/privacy/diff_privacy/optimizer/optimizer.py function tensor_grad_scale (line 37) | def tensor_grad_scale(scale, grad): class _TupleAdd (line 42) | class _TupleAdd(nn.Cell): method __init__ (line 43) | def __init__(self): method construct (line 48) | def construct(self, input1, input2): class DPOptimizerClassFactory (line 54) | class DPOptimizerClassFactory: method __init__ (line 82) | def __init__(self, micro_batches=2): method set_mechanisms (line 87) | def set_mechanisms(self, policy, *args, **kwargs): method create (line 97) | def create(self, policy): method _get_dp_optimizer_class (line 122) | def _get_dp_optimizer_class(self, opt_class): FILE: mindarmour/privacy/diff_privacy/train/model.py function tensor_grad_scale (line 61) | def tensor_grad_scale(scale, grad): class DPModel (line 66) | class DPModel(Model): method __init__ (line 95) | def __init__(self, micro_batches=2, norm_bound=1.0, noise_mech=None, method _amp_build_train_network (line 147) | def _amp_build_train_network(self, network, optimizer, loss_fn=None, method _build_train_network (line 227) | def _build_train_network(self): class _ClipGradients (line 271) | class _ClipGradients(nn.Cell): method __init__ (line 285) | def __init__(self): method construct (line 292) | def construct(self, grads, clip_norm, cur_norm=None): class _TupleAdd (line 313) | class _TupleAdd(nn.Cell): method __init__ (line 314) | def __init__(self): method construct (line 319) | def construct(self, input1, input2): class _TrainOneStepWithLossScaleCell (line 325) | class _TrainOneStepWithLossScaleCell(Cell): method __init__ (line 364) | def __init__(self, network, optimizer, scale_update_cell=None, method construct (line 436) | def construct(self, data, label, sens=None): class _TrainOneStepCell (line 550) | class _TrainOneStepCell(Cell): method __init__ (line 581) | def __init__(self, network, optimizer, norm_bound=1.0, sens=1.0, method construct (line 639) | def construct(self, data, label): FILE: mindarmour/privacy/evaluation/_check_config.py function _is_positive_int (line 28) | def _is_positive_int(item): function _is_non_negative_int (line 35) | def _is_non_negative_int(item): function _is_positive_float (line 42) | def _is_positive_float(item): function _is_non_negative_float (line 49) | def _is_non_negative_float(item): function _is_range_0_1_float (line 56) | def _is_range_0_1_float(item): function _is_positive_int_tuple (line 62) | def _is_positive_int_tuple(item): function _is_dict (line 72) | def _is_dict(item): function _is_list (line 77) | def _is_list(item): function _is_str (line 82) | def _is_str(item): function _check_config (line 156) | def _check_config(attack_config, config_checklist): function verify_config_params (line 207) | def verify_config_params(attack_config): FILE: mindarmour/privacy/evaluation/attacker.py function _attack_knn (line 34) | def _attack_knn(features, labels, param_grid, n_jobs): function _attack_lr (line 56) | def _attack_lr(features, labels, param_grid, n_jobs): function _attack_mlpc (line 78) | def _attack_mlpc(features, labels, param_grid, n_jobs): function _attack_rf (line 100) | def _attack_rf(features, labels, random_grid, n_jobs): function _get_attack_model (line 123) | def _get_attack_model(features, labels, config, n_jobs=-1): FILE: mindarmour/privacy/evaluation/inversion_attack.py class InversionLoss (line 36) | class InversionLoss(Cell): method __init__ (line 45) | def __init__(self, network, weights): method construct (line 54) | def construct(self, input_data, target_features): class ImageInversionAttack (line 94) | class ImageInversionAttack: method __init__ (line 139) | def __init__(self, network, input_shape, input_bound, loss_weights=(1,... method generate (line 155) | def generate(self, target_features, iters=100): method evaluate (line 200) | def evaluate(self, original_images, inversion_images, labels=None, new... FILE: mindarmour/privacy/evaluation/membership_inference.py function _eval_info (line 35) | def _eval_info(pred, truth, option): function _softmax_cross_entropy (line 74) | def _softmax_cross_entropy(logits, labels, epsilon=1e-12): class MembershipInference (line 95) | class MembershipInference: method __init__ (line 160) | def __init__(self, model, n_jobs=-1): method train (line 171) | def train(self, dataset_train, dataset_test, attack_config): method eval (line 209) | def eval(self, dataset_train, dataset_test, metrics): method _transform (line 244) | def _transform(self, dataset_train, dataset_test): method _generate (line 268) | def _generate(self, input_dataset, label): FILE: mindarmour/privacy/evaluation/model_inversion_attack.py class ModelInversionLoss (line 32) | class ModelInversionLoss(nn.Cell): method __init__ (line 42) | def __init__(self, network, invnet, loss_fn, target_layer='conv1'): method construct (line 50) | def construct(self, inputs): class ModelInversionAttack (line 57) | class ModelInversionAttack: method __init__ (line 73) | def __init__(self, network, inv_network, input_shape, ckpoint_path=Non... method check_inv_network (line 85) | def check_inv_network(self, input_shape): method train_inversion_model (line 96) | def train_inversion_model(self, dataset, epochs=50, learningrate=1e-3,... method evaluate (line 135) | def evaluate(self, dataset): method inverse (line 171) | def inverse(self, target_feature): FILE: mindarmour/privacy/evaluation/shadow_model_attack.py class ShadowModelLoss (line 31) | class ShadowModelLoss(nn.Cell): method __init__ (line 35) | def __init__(self, network, shadow_net, loss_fn, target_layer='conv11'): method construct (line 43) | def construct(self, inputs, targets): class ShadowModelAttack (line 50) | class ShadowModelAttack: method __init__ (line 101) | def __init__(self, network, shadow_network, ckpoint_path='', split_lay... method train_shadow_model (line 114) | def train_shadow_model(self, dataset, attack_config): method evaluate (line 159) | def evaluate(self, dataset, num_classes=10): FILE: mindarmour/privacy/sup_privacy/mask_monitor/masker.py class SuppressMasker (line 27) | class SuppressMasker(Callback): method __init__ (line 80) | def __init__(self, model, suppress_ctrl): method step_end (line 87) | def step_end(self, run_context): FILE: mindarmour/privacy/sup_privacy/sup_ctrl/conctrl.py class SuppressPrivacyFactory (line 34) | class SuppressPrivacyFactory: method __init__ (line 42) | def __init__(self): method create (line 46) | def create(networks, mask_layers, policy="local_train", end_epoch=10, ... class SuppressCtrl (line 121) | class SuppressCtrl(Cell): method __init__ (line 142) | def __init__(self, networks, mask_layers, end_epoch, batch_num, start_... method _check_params (line 240) | def _check_params(self): method _check_mask_layers (line 281) | def _check_mask_layers(self): method update_status (line 305) | def update_status(self, cur_epoch, cur_step, cur_step_in_epoch): method update_mask (line 333) | def update_mask(self, networks, cur_step, target_sparse=0.0): method update_mask_layer (line 414) | def update_mask_layer(self, weight_array_flat, sparse_weight_thd, spar... method update_mask_layer_approximity (line 496) | def update_mask_layer_approximity(self, weight_array_flat, weight_arra... method reset_zeros (line 587) | def reset_zeros(self): method calc_theoretical_sparse_for_conv (line 594) | def calc_theoretical_sparse_for_conv(self): method calc_actual_sparse_for_conv (line 625) | def calc_actual_sparse_for_conv(self, networks): method calc_actual_sparse_for_fc1 (line 687) | def calc_actual_sparse_for_fc1(self, networks): method calc_actual_sparse_for_layer (line 696) | def calc_actual_sparse_for_layer(self, networks, layer_name): method print_paras (line 736) | def print_paras(self): function get_one_mask_layer (line 751) | def get_one_mask_layer(mask_layers, layer_name): class MaskLayerDes (line 768) | class MaskLayerDes: method __init__ (line 800) | def __init__(self, layer_name, grad_idx, is_add_noise, is_lower_clip, ... class GradMaskInCell (line 811) | class GradMaskInCell(Cell): method __init__ (line 826) | def __init__(self, array, is_add_noise, is_lower_clip, min_num, upper_... method construct (line 863) | def construct(self): method update (line 869) | def update(self): class DeWeightInCell (line 876) | class DeWeightInCell(Cell): method __init__ (line 884) | def __init__(self, array): method construct (line 894) | def construct(self): method update (line 902) | def update(self): method reset_zeros (line 909) | def reset_zeros(self): FILE: mindarmour/privacy/sup_privacy/train/model.py function tensor_grad_scale (line 51) | def tensor_grad_scale(scale, grad): class SuppressModel (line 56) | class SuppressModel(Model): method __init__ (line 70) | def __init__(self, method link_suppress_ctrl (line 84) | def link_suppress_ctrl(self, suppress_pri_ctrl): method _build_train_network (line 97) | def _build_train_network(self): method _amp_build_train_network (line 123) | def _amp_build_train_network(self, network, optimizer, loss_fn=None, class _TupleAdd (line 174) | class _TupleAdd(nn.Cell): method __init__ (line 178) | def __init__(self): method construct (line 183) | def construct(self, input1, input2): class _TupleMul (line 189) | class _TupleMul(nn.Cell): method __init__ (line 193) | def __init__(self): method construct (line 198) | def construct(self, input1, input2): class TrainOneStepCell (line 204) | class TrainOneStepCell(Cell): method __init__ (line 225) | def __init__(self, network, optimizer, sens=1.0): method link_suppress_ctrl (line 251) | def link_suppress_ctrl(self, suppress_pri_ctrl): method construct (line 268) | def construct(self, data, label): FILE: mindarmour/reliability/concept_drift/concept_drift_check_images.py class OodDetector (line 29) | class OodDetector: method __init__ (line 38) | def __init__(self, model, ds_train): method _feature_extract (line 45) | def _feature_extract(self, model, data, layer='output[:Tensor]'): method get_optimal_threshold (line 63) | def get_optimal_threshold(self, label, ds_eval): method ood_predict (line 77) | def ood_predict(self, threshold, ds_test): class OodDetectorFeatureCluster (line 93) | class OodDetectorFeatureCluster(OodDetector): method __init__ (line 142) | def __init__(self, model, ds_train, n_cluster, layer): method _feature_cluster (line 151) | def _feature_cluster(self): method _get_ood_score (line 163) | def _get_ood_score(self, ds_test): method get_optimal_threshold (line 187) | def get_optimal_threshold(self, label, ds_eval): method ood_predict (line 219) | def ood_predict(self, threshold, ds_test): FILE: mindarmour/reliability/concept_drift/concept_drift_check_time_series.py class ConceptDriftCheckTimeSeries (line 23) | class ConceptDriftCheckTimeSeries: method __init__ (line 48) | def __init__(self, window_size=100, rolling_window=10, method _reservoir_model_feature (line 59) | def _reservoir_model_feature(self, window_data): method _concept_distance (line 91) | def _concept_distance(self, data_x, data_y): method _data_process (line 118) | def _data_process(self, data): method concept_check (line 149) | def concept_check(self, data): function _result_save (line 191) | def _result_save(original_data, threshold, concept_location, drift_point... function _original_label (line 220) | def _original_label(original_data, threshold, drift_score, window_size, ... function _label_continue_process (line 249) | def _label_continue_process(label): function _find_loc (line 273) | def _find_loc(label_location): function _continue_block (line 277) | def _continue_block(location): function _drift_blocks (line 294) | def _drift_blocks(drift_score, label_continue, label_location): function _w_generate (line 326) | def _w_generate(res_size, in_size, input_data): function _cal_distance (line 359) | def _cal_distance(matrix1, matrix2): function _cal_threshold (line 376) | def _cal_threshold(distance, threshold_index): FILE: mindarmour/reliability/model_fault_injection/fault_injection.py class FaultInjector (line 29) | class FaultInjector: method __init__ (line 78) | def __init__(self, model, fi_type=None, fi_mode=None, fi_size=None): method _check_param (line 93) | def _check_param(self): method _init_running_list (line 115) | def _init_running_list(self, type_, mode_, size_): method _frozen (line 148) | def _frozen(self): method _reset_model (line 159) | def _reset_model(self): method _calculate_batch_size (line 175) | def _calculate_batch_size(num, iter_times): method _check_kick_off_param (line 191) | def _check_kick_off_param(ds_data, ds_label, iter_times): method kick_off (line 199) | def kick_off(self, ds_data, ds_label, iter_times=100): method metrics (line 244) | def metrics(self): method _layer_states (line 280) | def _layer_states(self, fi_type, fi_mode, fi_size): FILE: mindarmour/reliability/model_fault_injection/fault_type.py class FaultType (line 26) | class FaultType: method _bitflip (line 29) | def _bitflip(value, pos): method _fault_inject (line 50) | def _fault_inject(self, value, fi_type, fi_size): method _bitflips_random (line 86) | def _bitflips_random(self, value, fi_indices): method _bitflips_designated (line 104) | def _bitflips_designated(self, value, fi_indices): method _random (line 129) | def _random(value, fi_indices): method _zeros (line 144) | def _zeros(value, fi_indices): method _nan (line 158) | def _nan(value, fi_indices): method _inf (line 175) | def _inf(value, fi_indices): method _anti_activation (line 192) | def _anti_activation(value, fi_indices): method _precision_loss (line 206) | def _precision_loss(value, fi_indices): FILE: mindarmour/utils/_check_param.py function _check_binary_rel (line 41) | def _check_binary_rel(val1, val2, rel): function _format_str_one_value (line 63) | def _format_str_one_value(value, rel): function _check_array_not_empty (line 85) | def _check_array_not_empty(arg_name, arg_value): function check_param_type (line 101) | def check_param_type(arg_name, arg_value, valid_type): function check_param_multi_types (line 111) | def check_param_multi_types(arg_name, arg_value, valid_types): function check_int_positive (line 121) | def check_int_positive(arg_name, arg_value): function check_value_non_negative (line 136) | def check_value_non_negative(arg_name, arg_value): function check_value_positive (line 146) | def check_value_positive(arg_name, arg_value): function check_param_in_range (line 156) | def check_param_in_range(arg_name, arg_value, lower, upper): function check_model (line 168) | def check_model(model_name, model, model_type): function check_numpy_param (line 190) | def check_numpy_param(arg_name, arg_value): function check_pair_numpy_param (line 217) | def check_pair_numpy_param(inputs_name, inputs, labels_name, labels): function check_equal_length (line 245) | def check_equal_length(para_name1, value1, para_name2, value2): function check_equal_shape (line 255) | def check_equal_shape(para_name1, value1, para_name2, value2): function check_norm_level (line 265) | def check_norm_level(norm_level): function normalize_value (line 277) | def normalize_value(value, norm_level): function check_detection_inputs (line 313) | def check_detection_inputs(inputs, labels): function check_inputs_labels (line 373) | def check_inputs_labels(inputs, labels): function check_param_bounds (line 389) | def check_param_bounds(arg_name, arg_value): function check_value_type (line 409) | def check_value_type(arg_name, arg_value, valid_types, prim_name=None): function check (line 435) | def check(arg_name, arg_value, value_name, value, rel=EQ, prim_name=None... FILE: mindarmour/utils/logger.py function _find_caller (line 20) | def _find_caller(): class LogUtil (line 29) | class LogUtil: method __init__ (line 42) | def __init__(self): method get_instance (line 46) | def get_instance(): method _init_logger (line 60) | def _init_logger(): method set_level (line 80) | def set_level(self, level): method add_handler (line 94) | def add_handler(self, handler): method debug (line 110) | def debug(self, tag, msg, *args): method info (line 127) | def info(self, tag, msg, *args): method warn (line 144) | def warn(self, tag, msg, *args): method error (line 161) | def error(self, tag, msg, *args): FILE: mindarmour/utils/util.py function jacobian_matrix (line 30) | def jacobian_matrix(grad_wrap_net, inputs, num_classes): function jacobian_matrix_for_detection (line 59) | def jacobian_matrix_for_detection(grad_wrap_net, inputs, num_boxes, num_... class WithLossCell (line 96) | class WithLossCell(Cell): method __init__ (line 124) | def __init__(self, network, loss_fn): method construct (line 129) | def construct(self, data, label): class GradWrapWithLoss (line 144) | class GradWrapWithLoss(Cell): method __init__ (line 176) | def __init__(self, network): method construct (line 181) | def construct(self, inputs, labels): class GradWrap (line 196) | class GradWrap(Cell): method __init__ (line 229) | def __init__(self, network): method construct (line 234) | def construct(self, *data): function calculate_iou (line 252) | def calculate_iou(box_i, box_j): function to_tensor_tuple (line 285) | def to_tensor_tuple(inputs_ori): function calculate_lp_distance (line 297) | def calculate_lp_distance(original_image, compared_image): function _crop (line 331) | def _crop(arr, crop_width): function compute_ssim (line 358) | def compute_ssim(original_image, compared_image): function compute_psnr (line 436) | def compute_psnr(original_image, compared_image, data_range=None): FILE: setup.py function clean (line 32) | def clean(): function write_version (line 43) | def write_version(file): function build_depends (line 48) | def build_depends(): function update_permissions (line 59) | def update_permissions(path): function get_description (line 75) | def get_description(): class EggInfo (line 97) | class EggInfo(egg_info): method run (line 99) | def run(self): class BuildPy (line 105) | class BuildPy(build_py): method run (line 107) | def run(self): FILE: tests/ut/python/adv_robustness/attacks/black/test_genetic_attack.py class ModelToBeAttacked (line 31) | class ModelToBeAttacked(BlackModel): method __init__ (line 34) | def __init__(self, network): method predict (line 38) | def predict(self, inputs): class DetectionModel (line 44) | class DetectionModel(BlackModel): method predict (line 47) | def predict(self, inputs): class SimpleNet (line 66) | class SimpleNet(Cell): method __init__ (line 74) | def __init__(self): method construct (line 81) | def construct(self, inputs): function test_genetic_attack (line 97) | def test_genetic_attack(): function test_supplement (line 125) | def test_supplement(): function test_value_error (line 151) | def test_value_error(): function test_genetic_attack_detection_cpu (line 178) | def test_genetic_attack_detection_cpu(): FILE: tests/ut/python/adv_robustness/attacks/black/test_hsja.py class ModelToBeAttacked (line 35) | class ModelToBeAttacked(BlackModel): method __init__ (line 38) | def __init__(self, network): method predict (line 42) | def predict(self, inputs): function random_target_labels (line 50) | def random_target_labels(true_labels): function create_target_images (line 61) | def create_target_images(dataset, data_labels, target_labels): function get_model (line 72) | def get_model(): function test_hsja_mnist_attack_ascend (line 90) | def test_hsja_mnist_attack_ascend(): function test_hsja_mnist_attack_cpu (line 164) | def test_hsja_mnist_attack_cpu(): function test_value_error_ascend (line 240) | def test_value_error_ascend(): function test_value_error_cpu (line 252) | def test_value_error_cpu(): FILE: tests/ut/python/adv_robustness/attacks/black/test_nes.py class ModelToBeAttacked (line 34) | class ModelToBeAttacked(BlackModel): method __init__ (line 37) | def __init__(self, network): method predict (line 41) | def predict(self, inputs): function random_target_labels (line 49) | def random_target_labels(true_labels): function _pseudorandom_target (line 60) | def _pseudorandom_target(index, total_indices, true_class): function create_target_images (line 69) | def create_target_images(dataset, data_labels, target_labels): function get_model (line 79) | def get_model(current_dir): function get_dataset (line 90) | def get_dataset(current_dir): function nes_mnist_attack (line 101) | def nes_mnist_attack(scene, top_k): function test_nes_query_limit_ascend (line 167) | def test_nes_query_limit_ascend(): function test_nes_query_limit_cpu (line 183) | def test_nes_query_limit_cpu(): function test_nes_partial_info_ascend (line 200) | def test_nes_partial_info_ascend(): function test_nes_partial_info_cpu (line 216) | def test_nes_partial_info_cpu(): function test_nes_label_only_ascend (line 233) | def test_nes_label_only_ascend(): function test_nes_label_only_cpu (line 249) | def test_nes_label_only_cpu(): function test_value_error_ascend (line 266) | def test_value_error_ascend(): function test_value_error_cpu (line 277) | def test_value_error_cpu(): function test_none_ascend (line 289) | def test_none_ascend(): function test_none_cpu (line 308) | def test_none_cpu(): FILE: tests/ut/python/adv_robustness/attacks/black/test_pointwise_attack.py class ModelToBeAttacked (line 38) | class ModelToBeAttacked(BlackModel): method __init__ (line 41) | def __init__(self, network): method predict (line 45) | def predict(self, inputs): function test_pointwise_attack_method_ascend (line 56) | def test_pointwise_attack_method_ascend(): function test_pointwise_attack_method_cpu (line 98) | def test_pointwise_attack_method_cpu(): FILE: tests/ut/python/adv_robustness/attacks/black/test_pso_attack.py class ModelToBeAttacked (line 31) | class ModelToBeAttacked(BlackModel): method __init__ (line 34) | def __init__(self, network): method predict (line 38) | def predict(self, inputs): class DetectionModel (line 47) | class DetectionModel(BlackModel): method predict (line 50) | def predict(self, inputs): class SimpleNet (line 69) | class SimpleNet(Cell): method __init__ (line 77) | def __init__(self): method construct (line 85) | def construct(self, inputs): function test_pso_attack (line 101) | def test_pso_attack(): function test_pso_attack_targeted (line 127) | def test_pso_attack_targeted(): function test_pso_attack_gpu (line 153) | def test_pso_attack_gpu(): function test_pso_attack_cpu (line 178) | def test_pso_attack_cpu(): function test_pso_attack_detection_cpu (line 203) | def test_pso_attack_detection_cpu(): FILE: tests/ut/python/adv_robustness/attacks/black/test_salt_and_pepper_attack.py class ModelToBeAttacked (line 33) | class ModelToBeAttacked(BlackModel): method __init__ (line 36) | def __init__(self, network): method predict (line 40) | def predict(self, inputs): function test_salt_and_pepper_attack_method_ascend (line 51) | def test_salt_and_pepper_attack_method_ascend(): function test_salt_and_pepper_attack_method_cpu (line 85) | def test_salt_and_pepper_attack_method_cpu(): FILE: tests/ut/python/adv_robustness/attacks/test_batch_generate_attack.py class Net (line 31) | class Net(Cell): method __init__ (line 39) | def __init__(self): method construct (line 46) | def construct(self, inputs): class Net2 (line 57) | class Net2(Cell): method __init__ (line 65) | def __init__(self): method construct (line 69) | def construct(self, inputs1, inputs2): class LossNet (line 75) | class LossNet(Cell): method construct (line 79) | def construct(self, loss1, loss2, labels1, labels2): class WithLossCell (line 83) | class WithLossCell(Cell): method __init__ (line 85) | def __init__(self, backbone, loss_fn): method construct (line 90) | def construct(self, inputs1, inputs2, labels1, labels2): class GradWrapWithLoss (line 95) | class GradWrapWithLoss(Cell): method __init__ (line 101) | def __init__(self, network): method construct (line 106) | def construct(self, *inputs): function test_batch_generate_attack_ascend (line 116) | def test_batch_generate_attack_ascend(): function test_batch_generate_attack_cpu (line 141) | def test_batch_generate_attack_cpu(): function test_batch_generate_attack_multi_inputs_ascend (line 167) | def test_batch_generate_attack_multi_inputs_ascend(): function test_batch_generate_attack_multi_inputs_cpu (line 196) | def test_batch_generate_attack_multi_inputs_cpu(): FILE: tests/ut/python/adv_robustness/attacks/test_cw.py class Net (line 30) | class Net(Cell): method __init__ (line 38) | def __init__(self): method construct (line 45) | def construct(self, inputs): function test_cw_attack_ascend (line 61) | def test_cw_attack_ascend(): function test_cw_attack_cpu (line 83) | def test_cw_attack_cpu(): function test_cw_attack_targeted_ascend (line 106) | def test_cw_attack_targeted_ascend(): function test_cw_attack_targeted_cpu (line 128) | def test_cw_attack_targeted_cpu(): FILE: tests/ut/python/adv_robustness/attacks/test_deep_fool.py class Net (line 30) | class Net(Cell): method __init__ (line 38) | def __init__(self): method construct (line 45) | def construct(self, inputs): class Net2 (line 56) | class Net2(Cell): method __init__ (line 63) | def __init__(self): method construct (line 67) | def construct(self, inputs1, inputs2): function test_deepfool_attack_ascend (line 78) | def test_deepfool_attack_ascend(): function test_deepfool_attack_cpu (line 108) | def test_deepfool_attack_cpu(): function test_deepfool_attack_detection_ascend (line 138) | def test_deepfool_attack_detection_ascend(): function test_deepfool_attack_detection_cpu (line 165) | def test_deepfool_attack_detection_cpu(): function test_deepfool_attack_inf_ascend (line 193) | def test_deepfool_attack_inf_ascend(): function test_deepfool_attack_inf_cpu (line 218) | def test_deepfool_attack_inf_cpu(): function test_value_error_ascend (line 244) | def test_value_error_ascend(): function test_value_error_cpu (line 269) | def test_value_error_cpu(): FILE: tests/ut/python/adv_robustness/attacks/test_gradient_method.py class Net (line 35) | class Net(Cell): method __init__ (line 43) | def __init__(self): method construct (line 50) | def construct(self, inputs): class Net2 (line 61) | class Net2(Cell): method __init__ (line 69) | def __init__(self): method construct (line 73) | def construct(self, inputs1, inputs2): class LossNet (line 79) | class LossNet(Cell): method construct (line 83) | def construct(self, loss1, loss2, labels1, labels2): class WithLossCell (line 87) | class WithLossCell(Cell): method __init__ (line 89) | def __init__(self, backbone, loss_fn): method construct (line 94) | def construct(self, inputs1, inputs2, labels1, labels2): class GradWrapWithLoss (line 99) | class GradWrapWithLoss(Cell): method __init__ (line 105) | def __init__(self, network): method construct (line 110) | def construct(self, *inputs): function test_fast_gradient_method (line 120) | def test_fast_gradient_method(): function test_fast_gradient_method_gpu (line 142) | def test_fast_gradient_method_gpu(): function test_fast_gradient_method_cpu (line 163) | def test_fast_gradient_method_cpu(): function test_random_fast_gradient_method (line 185) | def test_random_fast_gradient_method(): function test_fast_gradient_sign_method (line 208) | def test_fast_gradient_sign_method(): function test_random_fast_gradient_sign_method (line 231) | def test_random_fast_gradient_sign_method(): function test_least_likely_class_method (line 254) | def test_least_likely_class_method(): function test_random_least_likely_class_method (line 277) | def test_random_least_likely_class_method(): function test_fast_gradient_method_multi_inputs (line 301) | def test_fast_gradient_method_multi_inputs(): function test_assert_error (line 326) | def test_assert_error(): FILE: tests/ut/python/adv_robustness/attacks/test_iterative_gradient_method.py class Net (line 36) | class Net(Cell): method __init__ (line 44) | def __init__(self): method construct (line 48) | def construct(self, inputs): class FlattenNet (line 59) | class FlattenNet(Cell): method __init__ (line 67) | def __init__(self): method construct (line 72) | def construct(self, inputs): function test_basic_iterative_method_ascend (line 89) | def test_basic_iterative_method_ascend(): function test_basic_iterative_method_cpu (line 115) | def test_basic_iterative_method_cpu(): function test_momentum_iterative_method_ascend (line 142) | def test_momentum_iterative_method_ascend(): function test_momentum_iterative_method_cpu (line 167) | def test_momentum_iterative_method_cpu(): function test_projected_gradient_descent_method_ascend (line 193) | def test_projected_gradient_descent_method_ascend(): function test_projected_gradient_descent_method_cpu (line 220) | def test_projected_gradient_descent_method_cpu(): function test_diverse_input_iterative_method_ascend (line 248) | def test_diverse_input_iterative_method_ascend(): function test_diverse_input_iterative_method_cpu (line 272) | def test_diverse_input_iterative_method_cpu(): function test_momentum_diverse_input_iterative_method_ascend (line 297) | def test_momentum_diverse_input_iterative_method_ascend(): function test_momentum_diverse_input_iterative_method_cpu (line 321) | def test_momentum_diverse_input_iterative_method_cpu(): function test_error_ascend (line 347) | def test_error_ascend(): function test_error_cpu (line 367) | def test_error_cpu(): function test_variance_tuning_momentum_iterative_method_cpu (line 388) | def test_variance_tuning_momentum_iterative_method_cpu(): FILE: tests/ut/python/adv_robustness/attacks/test_jsma.py class Net (line 29) | class Net(Cell): method __init__ (line 37) | def __init__(self): method construct (line 44) | def construct(self, inputs): function test_jsma_attack (line 60) | def test_jsma_attack(): function test_jsma_attack_2 (line 89) | def test_jsma_attack_2(): function test_jsma_attack_gpu (line 118) | def test_jsma_attack_gpu(): function test_jsma_attack_cpu (line 147) | def test_jsma_attack_cpu(): FILE: tests/ut/python/adv_robustness/attacks/test_lbfgs.py function test_lbfgs_attack_ascend (line 42) | def test_lbfgs_attack_ascend(): function test_lbfgs_attack_cpu (line 82) | def test_lbfgs_attack_cpu(): FILE: tests/ut/python/adv_robustness/defenses/test_ad.py function test_ad (line 40) | def test_ad(): FILE: tests/ut/python/adv_robustness/defenses/test_ead.py function test_ead (line 42) | def test_ead(): FILE: tests/ut/python/adv_robustness/defenses/test_nad.py function test_nad (line 39) | def test_nad(): FILE: tests/ut/python/adv_robustness/defenses/test_pad.py function test_pad (line 39) | def test_pad(): FILE: tests/ut/python/adv_robustness/detectors/black/test_similarity_detector.py class EncoderNet (line 28) | class EncoderNet(Cell): method __init__ (line 33) | def __init__(self, encode_dim): method construct (line 38) | def construct(self, inputs): method get_encode_dim (line 48) | def get_encode_dim(self): function test_similarity_detector_ascend (line 63) | def test_similarity_detector_ascend(): function test_similarity_detector_cpu (line 109) | def test_similarity_detector_cpu(): FILE: tests/ut/python/adv_robustness/detectors/test_ensemble_detector.py class Net (line 31) | class Net(Cell): method __init__ (line 35) | def __init__(self): method construct (line 39) | def construct(self, inputs): class AutoNet (line 49) | class AutoNet(Cell): method __init__ (line 53) | def __init__(self): method construct (line 57) | def construct(self, inputs): function test_ensemble_detector_ascend (line 72) | def test_ensemble_detector_ascend(): function test_ensemble_detector_cpu (line 100) | def test_ensemble_detector_cpu(): function test_error_ascend (line 129) | def test_error_ascend(): function test_error_cpu (line 155) | def test_error_cpu(): FILE: tests/ut/python/adv_robustness/detectors/test_mag_net.py class Net (line 31) | class Net(Cell): method __init__ (line 36) | def __init__(self): method construct (line 40) | def construct(self, inputs): class PredNet (line 50) | class PredNet(Cell): method __init__ (line 55) | def __init__(self): method construct (line 61) | def construct(self, inputs): function test_mag_net_ascend (line 77) | def test_mag_net_ascend(): function test_mag_net_cpu (line 100) | def test_mag_net_cpu(): function test_mag_net_transform_ascend (line 124) | def test_mag_net_transform_ascend(): function test_mag_net_transform_cpu (line 143) | def test_mag_net_transform_cpu(): function test_mag_net_divergence_ascend (line 163) | def test_mag_net_divergence_ascend(): function test_mag_net_divergence_cpu (line 188) | def test_mag_net_divergence_cpu(): function test_mag_net_divergence_transform_ascend (line 214) | def test_mag_net_divergence_transform_ascend(): function test_mag_net_divergence_transform_cpu (line 234) | def test_mag_net_divergence_transform_cpu(): function test_value_error_ascend (line 255) | def test_value_error_ascend(): function test_value_error_cpu (line 275) | def test_value_error_cpu(): FILE: tests/ut/python/adv_robustness/detectors/test_region_based_detector.py class Net (line 29) | class Net(Cell): method __init__ (line 33) | def __init__(self): method construct (line 37) | def construct(self, inputs): function test_region_based_classification_ascend (line 52) | def test_region_based_classification_ascend(): function test_region_based_classification_cpu (line 78) | def test_region_based_classification_cpu(): function test_value_error_ascend (line 105) | def test_value_error_ascend(): function test_value_error_cpu (line 154) | def test_value_error_cpu(): FILE: tests/ut/python/adv_robustness/detectors/test_spatial_smoothing.py class Net (line 30) | class Net(Cell): method __init__ (line 34) | def __init__(self): method construct (line 38) | def construct(self, inputs): function test_spatial_smoothing_ascend (line 53) | def test_spatial_smoothing_ascend(): function test_spatial_smoothing_cpu (line 84) | def test_spatial_smoothing_cpu(): function test_spatial_smoothing_diff_ascend (line 116) | def test_spatial_smoothing_diff_ascend(): function test_spatial_smoothing_diff_cpu (line 156) | def test_spatial_smoothing_diff_cpu(): FILE: tests/ut/python/adv_robustness/evaluations/black/test_black_defense_eval.py function test_def_eval (line 28) | def test_def_eval(): FILE: tests/ut/python/adv_robustness/evaluations/test_attack_eval.py function test_attack_eval (line 28) | def test_attack_eval(): function test_value_error (line 61) | def test_value_error(): function test_empty_input_error (line 84) | def test_empty_input_error(): FILE: tests/ut/python/adv_robustness/evaluations/test_defense_eval.py function test_def_eval (line 28) | def test_def_eval(): FILE: tests/ut/python/adv_robustness/evaluations/test_radar_metric.py function test_radar_metric (line 27) | def test_radar_metric(): function test_value_error (line 45) | def test_value_error(): FILE: tests/ut/python/fuzzing/test_coverage_metrics.py class Net (line 37) | class Net(Cell): method __init__ (line 45) | def __init__(self): method construct (line 53) | def construct(self, inputs): function test_lenet_mnist_coverage_cpu (line 71) | def test_lenet_mnist_coverage_cpu(): function test_lenet_mnist_coverage_ascend (line 126) | def test_lenet_mnist_coverage_ascend(): FILE: tests/ut/python/fuzzing/test_fuzzer.py function conv (line 35) | def conv(in_channels, out_channels, kernel_size, stride=1, padding=0): function fc_with_initialize (line 42) | def fc_with_initialize(input_channels, out_channels): function weight_variable (line 48) | def weight_variable(): class Net (line 52) | class Net(nn.Cell): method __init__ (line 57) | def __init__(self): method construct (line 69) | def construct(self, x): function test_fuzzing_ascend (line 95) | def test_fuzzing_ascend(): function test_fuzzing_cpu (line 140) | def test_fuzzing_cpu(): FILE: tests/ut/python/natural_robustness/test_natural_robustness.py function test_perspective (line 30) | def test_perspective(): function test_uniform_noise (line 49) | def test_uniform_noise(): function test_gaussian_noise (line 66) | def test_gaussian_noise(): function test_contrast (line 83) | def test_contrast(): function test_gaussian_blur (line 100) | def test_gaussian_blur(): function test_salt_and_pepper_noise (line 117) | def test_salt_and_pepper_noise(): function test_translate (line 134) | def test_translate(): function test_scale (line 151) | def test_scale(): function test_shear (line 168) | def test_shear(): function test_rotate (line 185) | def test_rotate(): function test_curve (line 202) | def test_curve(): function test_natural_noise (line 219) | def test_natural_noise(): function test_gradient_luminance (line 236) | def test_gradient_luminance(): function test_motion_blur (line 260) | def test_motion_blur(): function test_gradient_blur (line 279) | def test_gradient_blur(): function test_perspective_ascend (line 301) | def test_perspective_ascend(): function test_uniform_noise_ascend (line 321) | def test_uniform_noise_ascend(): function test_gaussian_noise_ascend (line 339) | def test_gaussian_noise_ascend(): function test_contrast_ascend (line 357) | def test_contrast_ascend(): function test_gaussian_blur_ascend (line 375) | def test_gaussian_blur_ascend(): function test_salt_and_pepper_noise_ascend (line 393) | def test_salt_and_pepper_noise_ascend(): function test_translate_ascend (line 411) | def test_translate_ascend(): function test_scale_ascend (line 429) | def test_scale_ascend(): function test_shear_ascend (line 447) | def test_shear_ascend(): function test_rotate_ascend (line 465) | def test_rotate_ascend(): function test_curve_ascend (line 483) | def test_curve_ascend(): function test_natural_noise_ascend (line 501) | def test_natural_noise_ascend(): function test_gradient_luminance_ascend (line 519) | def test_gradient_luminance_ascend(): function test_motion_blur_ascend (line 544) | def test_motion_blur_ascend(): function test_gradient_blur_ascend (line 564) | def test_gradient_blur_ascend(): FILE: tests/ut/python/privacy/diff_privacy/test_mechanisms.py function test_graph_factory (line 33) | def test_graph_factory(): function test_pynative_factory (line 60) | def test_pynative_factory(): function test_pynative_gaussian (line 87) | def test_pynative_gaussian(): function test_graph_ada_gaussian (line 114) | def test_graph_ada_gaussian(): function test_pynative_ada_gaussian (line 135) | def test_pynative_ada_gaussian(): function test_graph_exponential (line 156) | def test_graph_exponential(): function test_pynative_exponential (line 178) | def test_pynative_exponential(): function test_ada_clip_gaussian_random_pynative (line 200) | def test_ada_clip_gaussian_random_pynative(): function test_ada_clip_gaussian_random_graph (line 231) | def test_ada_clip_gaussian_random_graph(): function test_pynative_clip_mech_factory (line 262) | def test_pynative_clip_mech_factory(): function test_graph_clip_mech_factory (line 285) | def test_graph_clip_mech_factory(): FILE: tests/ut/python/privacy/diff_privacy/test_model_train.py function dataset_generator (line 32) | def dataset_generator(): function test_dp_model_with_pynative_mode (line 49) | def test_dp_model_with_pynative_mode(): function test_dp_model_with_graph_mode (line 86) | def test_dp_model_with_graph_mode(): function test_dp_model_with_graph_mode_ada_gaussian (line 121) | def test_dp_model_with_graph_mode_ada_gaussian(): FILE: tests/ut/python/privacy/diff_privacy/test_monitor.py function dataset_generator (line 34) | def dataset_generator(): function test_dp_monitor (line 51) | def test_dp_monitor(): function test_dp_monitor_gpu (line 78) | def test_dp_monitor_gpu(): function test_dp_monitor_cpu (line 105) | def test_dp_monitor_cpu(): function test_dp_monitor_zcdp (line 133) | def test_dp_monitor_zcdp(): function test_dp_monitor_zcdp_gpu (line 160) | def test_dp_monitor_zcdp_gpu(): function test_dp_monitor_zcdp_cpu (line 187) | def test_dp_monitor_zcdp_cpu(): FILE: tests/ut/python/privacy/diff_privacy/test_optimizer.py function test_optimizer (line 30) | def test_optimizer(): function test_optimizer_gpu (line 48) | def test_optimizer_gpu(): function test_optimizer_cpu (line 66) | def test_optimizer_cpu(): FILE: tests/ut/python/privacy/evaluation/test_attacker.py function test_get_knn_model (line 29) | def test_get_knn_model(): function test_get_lr_model (line 48) | def test_get_lr_model(): function test_get_mlp_model (line 67) | def test_get_mlp_model(): function test_get_rf_model (line 88) | def test_get_rf_model(): FILE: tests/ut/python/privacy/evaluation/test_inversion_attack.py function test_inversion_attack_graph (line 33) | def test_inversion_attack_graph(): function test_inversion_attack_pynative (line 50) | def test_inversion_attack_pynative(): function test_inversion_attack_cpu (line 66) | def test_inversion_attack_cpu(): function test_inversion_attack2 (line 83) | def test_inversion_attack2(): FILE: tests/ut/python/privacy/evaluation/test_membership_inference.py function dataset_generator (line 34) | def dataset_generator(): function test_get_membership_inference_object (line 51) | def test_get_membership_inference_object(): function test_membership_inference_object_train (line 67) | def test_membership_inference_object_train(): function test_membership_inference_eval (line 93) | def test_membership_inference_eval(): FILE: tests/ut/python/privacy/sup_privacy/test_model_train.py function dataset_generator (line 36) | def dataset_generator(): function test_suppress_model_with_pynative_mode (line 52) | def test_suppress_model_with_pynative_mode(): FILE: tests/ut/python/reliability/concept_drift/test_concept_drift_images.py function test_concept_drift_image_ascend (line 39) | def test_concept_drift_image_ascend(): FILE: tests/ut/python/reliability/concept_drift/test_concept_drift_time_series.py function test_concept_drift_time_series_ascend (line 36) | def test_concept_drift_time_series_ascend(): FILE: tests/ut/python/reliability/model_fault_injection/test_fault_injection.py function dataset_generator (line 37) | def dataset_generator(): function test_fault_injector (line 55) | def test_fault_injector(): function test_wrong_model (line 97) | def test_wrong_model(): function test_wrong_data (line 140) | def test_wrong_data(): function test_wrong_fi_type (line 176) | def test_wrong_fi_type(): function test_wrong_fi_mode (line 220) | def test_wrong_fi_mode(): function test_wrong_fi_size (line 264) | def test_wrong_fi_size(): FILE: tests/ut/python/utils/mock_net.py function conv (line 21) | def conv(in_channels, out_channels, kernel_size, stride=1, padding=0): function fc_with_initialize (line 28) | def fc_with_initialize(input_channels, out_channels): function weight_variable (line 34) | def weight_variable(): class Net (line 38) | class Net(nn.Cell): method __init__ (line 42) | def __init__(self): method construct (line 53) | def construct(self, x): FILE: tests/ut/python/utils/test_log_util.py function test_logger (line 28) | def test_logger(): function test_value_error (line 57) | def test_value_error():