MCPcopy Create free account

hub / github.com/ChenWu98/agent-attack / functions

Functions246 in github.com/ChenWu98/agent-attack

↓ 45 callersMethodload
Loads model using load_pretrained_model()
agent_attack/models/llava.py:93
↓ 32 callersMethodto
(self, device: torch.device)
agent_attack/attacks/clip_attack.py:271
↓ 8 callersMethodclamp
(self, x: Tensor, ori_x: Tensor)
agent_attack/attacks/clip_attack.py:277
↓ 8 callersMethoddecode
(self, output_ids: Union[torch.Tensor, Sequence[int]], **kwargs)
agent_attack/util/interfaces.py:26
↓ 8 callersFunctionget_captioning_model
(hub_path: str)
agent_attack/models/__init__.py:32
↓ 7 callersMethodgenerate_answer
( self, pixel_values: torch.Tensor, questions: List[str], return_string_probab
agent_attack/models/llava.py:247
↓ 6 callersFunctionclamp
(x: torch.tensor, min_value=0, max_value=1)
agent_attack/attacks/clip_attack.py:28
↓ 5 callersFunctiondct
Discrete Cosine Transform, Type II (a.k.a. the DCT) For the meaning of the parameter `norm`, see: https://docs.scipy.org/doc/scipy-0.14.
agent_attack/attacks/clip_attack.py:62
↓ 5 callersMethodget_captioning_prompt_fn
Generates the full reference prompt for captioning tasks.
agent_attack/models/llava.py:136
↓ 5 callersFunctionidct
The inverse to DCT-II, which is a scaled Discrete Cosine Transform, Type III Our definition of idct is that idct(dct(x)) == x For the m
agent_attack/attacks/clip_attack.py:96
↓ 4 callersMethod__init__
(self, extractors: List[BaseFeatureExtractor], count_to_index: Callable)
agent_attack/surrogates/FeatureExtractors/Base.py:57
↓ 4 callersFunctionevaluate_from_pil
(model, image, inputs, outputs)
agent_attack/attacks/utils.py:45
↓ 4 callersFunctionevaluate_from_tensor
(model, image, inputs, outputs)
agent_attack/attacks/utils.py:30
↓ 4 callersMethodforward
Forward pass through the model, computing the loss for the given inputs.
agent_attack/models/llava.py:341
↓ 4 callersMethodgenerate
( self, image: Image, input_text: str, do_sample: bool, temperature: f
agent_attack/util/interfaces.py:59
↓ 4 callersMethodget_captioning_prompt_fn
Generates the full reference prompt for captioning tasks.
agent_attack/models/claude.py:80
↓ 4 callersFunctionget_examples
(traj_root)
agent_attack/data/attack_data.py:23
↓ 4 callersFunctionget_model
(hub_path: str)
agent_attack/models/__init__.py:17
↓ 4 callersMethodimage_processor
(self, images, return_tensors="pt")
agent_attack/models/llava.py:112
↓ 3 callersMethodinit
(self)
agent_attack/attacks/clip_attack.py:265
↓ 3 callersFunctionresize_image
(image, size)
agent_attack/attacks/utils.py:66
↓ 2 callersFunction_replace_target_caption
(obs_text: str, som_id: int, target_caption: str)
scripts/eval_step_attack.py:183
↓ 2 callersFunctiondct_2d
2-dimentional Discrete Cosine Transform, Type II (a.k.a. the DCT) For the meaning of the parameter `norm`, see: https://docs.scipy.org/d
agent_attack/attacks/clip_attack.py:140
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_step.py:302
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack_eval_refine_attack_only.py:739
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack.py:503
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline.py:423
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack_tree_search_attack_only.py:844
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack_tree_search_attack.py:842
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack_eval_refine_attack.py:735
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack_tree_search.py:831
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_step_attack.py:368
↓ 2 callersFunctiondump_config
(args: argparse.Namespace)
scripts/eval_pipeline_attack_eval_refine.py:685
↓ 2 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack_tree_search_attack_only.py:213
↓ 2 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack_tree_search_attack.py:213
↓ 2 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack_tree_search.py:213
↓ 2 callersMethodencode
(self, inputs: str, add_special_tokens: bool = False)
agent_attack/util/interfaces.py:23
↓ 2 callersFunctioneval_from_file
(args: argparse.Namespace, dataset, use_caption=True)
scripts/eval_step.py:261
↓ 2 callersFunctioneval_from_file
(args: argparse.Namespace, dataset, use_caption=True)
scripts/eval_step_attack.py:324
↓ 2 callersMethodfreeze
(self)
agent_attack/models/llava.py:108
↓ 2 callersMethodgetRefIds
(self, image_ids=None, cat_ids=None, ref_ids=None, split="")
agent_attack/util/loading/refer.py:154
↓ 2 callersFunctionget_attack_fn
(attack)
agent_attack/attacks/__init__.py:6
↓ 2 callersFunctionget_grid_image
(adversarial_image, clean_images)
misc/synthetic.py:122
↓ 2 callersMethodget_text_features
(self, x: str)
agent_attack/surrogates/FeatureExtractors/Clip.py:130
↓ 2 callersFunctionidct_2d
The inverse to 2D DCT-II, which is a scaled Discrete Cosine Transform, Type III Our definition of idct is that idct_2d(dct_2d(x)) == x
agent_attack/attacks/clip_attack.py:156
↓ 2 callersMethodload
(self)
agent_attack/util/interfaces.py:42
↓ 2 callersFunctionmaybe_update_best_action
(score, actions)
scripts/eval_pipeline_attack_tree_search_attack_only.py:577
↓ 2 callersFunctionmaybe_update_best_action
(score, actions)
scripts/eval_pipeline_attack_tree_search_attack.py:575
↓ 2 callersFunctionmaybe_update_best_action
(score, actions)
scripts/eval_pipeline_attack_tree_search.py:564
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_step.py:283
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack_eval_refine_attack_only.py:715
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack.py:479
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline.py:399
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack_tree_search_attack_only.py:820
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack_tree_search_attack.py:818
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack_eval_refine_attack.py:711
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack_tree_search.py:807
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_step_attack.py:349
↓ 2 callersFunctionprepare
(args: argparse.Namespace)
scripts/eval_pipeline_attack_eval_refine.py:661
↓ 2 callersFunctionremove_caption
(obs_text: str)
agent_attack/data/clean_data.py:15
↓ 2 callersFunctionresize_grid
(grid, grid_res, screen_res)
misc/synthetic.py:157
↓ 2 callersFunctionrun
(args: argparse.Namespace, dataset, use_caption=True)
scripts/eval_step.py:198
↓ 2 callersFunctionrun
(args: argparse.Namespace, dataset, use_caption=True)
scripts/eval_step_attack.py:255
↓ 2 callersMethodstring_match
(self, action, criterion)
agent_attack/eval/step.py:43
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack_eval_refine_attack_only.py:323
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack.py:282
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline.py:220
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack_tree_search_attack_only.py:306
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack_tree_search_attack.py:306
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack_eval_refine_attack.py:323
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack_tree_search.py:306
↓ 2 callersFunctiontest
(args: argparse.Namespace, config_file_list: list[str], use_caption=True)
scripts/eval_pipeline_attack_eval_refine.py:317
↓ 1 callersMethod__init__
( self, model: List[nn.Module], total_step: int = 10, random_start: bool = Fal
agent_attack/attacks/clip_attack.py:371
↓ 1 callersMethodattack
(self, *args, **kwargs)
agent_attack/attacks/clip_attack.py:248
↓ 1 callersMethodbegin_attack
(self, origin: torch.tensor)
agent_attack/attacks/clip_attack.py:462
↓ 1 callersFunctionbim
(model, image, inputs, outputs, epsilon=16 / 255, alpha=1 / 255, iters=4000, size=1536)
agent_attack/attacks/bim.py:18
↓ 1 callersFunctionclip_attack
(image, target_text, victim_text, epsilon=16 / 255, alpha=1 / 255, iters=500, size=None)
agent_attack/attacks/clip_attack.py:517
↓ 1 callersFunctionconcatenate_image
( img_path: str = "./generated", padding=1, img_shape=(32, 32, 3), row=10, col=10, sav
agent_attack/util/image_handling.py:72
↓ 1 callersFunctionconfig
()
scripts/eval_step.py:53
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack_eval_refine_attack_only.py:60
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack.py:57
↓ 1 callersFunctionconfig
()
scripts/run_cap_attack.py:12
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline.py:57
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack_tree_search_attack_only.py:63
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack_tree_search_attack.py:63
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack_eval_refine_attack.py:60
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack_tree_search.py:63
↓ 1 callersFunctionconfig
()
scripts/eval_step_attack.py:55
↓ 1 callersFunctionconfig
()
scripts/run_clip_attack.py:18
↓ 1 callersFunctionconfig
()
scripts/eval_pipeline_attack_eval_refine.py:60
↓ 1 callersMethodcreateIndex
Create mappings: 1) Refs: {ref_id: ref} 2) Anns: {ann_id: ann} 3) Imgs: {image_i
agent_attack/util/loading/refer.py:84
↓ 1 callersFunctioncreate_prompt_with_image
(prompt, image)
agent_attack/models/claude.py:29
↓ 1 callersFunctioncreate_prompt_with_image
(prompt, image)
agent_attack/models/gemini.py:53
↓ 1 callersFunctioncreate_prompt_with_image
(prompt, image, detail="high")
agent_attack/models/gpt4v.py:32
↓ 1 callersFunctiondct1
Discrete Cosine Transform, Type I :param x: the input signal :return: the DCT-I of the signal over the last dimension
agent_attack/attacks/clip_attack.py:36
↓ 1 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack_eval_refine_attack_only.py:230
↓ 1 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack.py:187
↓ 1 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline.py:178
↓ 1 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack_eval_refine_attack.py:230
↓ 1 callersFunctionearly_stop
Check whether need to stop early
scripts/eval_pipeline_attack_eval_refine.py:224
next →1–100 of 246, ranked by callers