MCPcopy Create free account

hub / github.com/cywinski/SAeUron / functions

Functions337 in github.com/cywinski/SAeUron

↓ 89 callersMethodto
(self, *args, **kwargs)
SAE/hooked_sd_noised_pipeline.py:662
↓ 28 callersMethodeval
( self, input_ids, prompt, seed=0, batch_size=1, height=512,
Diffusion-MU-Attack/src/tasks/classifier_.py:552
↓ 19 callersMethodsave
Save the SAEs to disk.
SAE/trainer.py:539
↓ 16 callersMethodload_from_disk
( path: Path | str, device: str | torch.device = "cpu", *, decoder: bool = Tru
SAE/sae.py:142
↓ 14 callersMethodget
(self)
Diffusion-MU-Attack/fastargs/config.py:191
↓ 13 callersMethodrun
(self)
Diffusion-MU-Attack/src/execs/attack.py:196
↓ 11 callersMethodfrom_pretrained
(cls, *args, **kwargs)
SAE/hooked_sd_noised_pipeline.py:45
↓ 11 callersMethodlog
(self, data: dict)
Diffusion-MU-Attack/src/loggers/base.py:11
↓ 10 callersMethoddecode
(self, top_acts: Tensor, top_indices: Tensor)
SAE/sae.py:260
↓ 10 callersMethodparams
(self, **kwargs)
Diffusion-MU-Attack/fastargs/section.py:30
↓ 9 callersMethodid2embedding
(self, input_ids)
Diffusion-MU-Attack/src/tasks/classifier_.py:347
↓ 9 callersMethodsave_img
(self, name: str, data: dict)
Diffusion-MU-Attack/src/loggers/base.py:27
↓ 8 callersMethodmaybe_all_reduce
(self, x: Tensor, op: str = "mean")
SAE/trainer.py:496
↓ 8 callersMethodselect_topk
Select the top-k latents.
SAE/sae.py:203
↓ 7 callersMethodstep
(self, model_output, timestep, sample, generator, return_dict)
SAE/hooked_scheduler.py:14
↓ 7 callersMethodstr2id
(self, prompt)
Diffusion-MU-Attack/src/tasks/classifier_.py:330
↓ 6 callersMethoddevice
(self)
SAE/sae.py:182
↓ 6 callersMethodenable_if
(self, condition)
Diffusion-MU-Attack/fastargs/section.py:17
↓ 6 callersMethodget_section
(self, section)
Diffusion-MU-Attack/fastargs/config.py:201
↓ 6 callersMethodpre_acts
(self, x: Tensor)
SAE/sae.py:189
↓ 5 callersMethod__setattr__
(self, name, value)
SAE/hooked_scheduler.py:37
↓ 5 callersMethodencode
Encode the input and select the top-k latents.
SAE/sae.py:252
↓ 5 callersMethodhelp
(self)
Diffusion-MU-Attack/fastargs/validation.py:78
↓ 5 callersMethodpreprocess_input
(self, x)
SAE/sae.py:269
↓ 4 callersMethod_register_general_hook
(self, position, hook)
SAE/hooked_sd_noised_pipeline.py:523
↓ 4 callersMethodcollect
(self, config)
Diffusion-MU-Attack/fastargs/config.py:32
↓ 4 callersMethodrun_with_hooks
Run the pipeline with hooks at specified positions. Returns the final output. Args: *args: Arguments to pass to
SAE/hooked_sd_noised_pipeline.py:49
↓ 4 callersMethodsave_to_disk
(self, path: Path | str)
SAE/sae.py:167
↓ 3 callersMethod_register_cache_hook
( self, position: str, cache_input: Dict, cache_output: Dict, uncondit
SAE/hooked_sd_noised_pipeline.py:490
↓ 3 callersMethodcheck
(self, value)
Diffusion-MU-Attack/fastargs/validation.py:70
↓ 3 callersFunctionfix_dict
(defdict)
Diffusion-MU-Attack/fastargs/dict_utils.py:48
↓ 3 callersFunctionget_current_config
()
Diffusion-MU-Attack/fastargs/state.py:5
↓ 3 callersMethodlocal_hookpoints
(self)
SAE/trainer.py:462
↓ 3 callersMethodlog
(self, data: Dict)
Diffusion-MU-Attack/src/loggers/wandb_.py:19
↓ 3 callersMethodlog
(self, data)
Diffusion-MU-Attack/src/loggers/json_/main.py:32
↓ 3 callersFunctionrec_dd
()
Diffusion-MU-Attack/fastargs/dict_utils.py:15
↓ 3 callersFunctionrecursive_set
(dic, path, value)
Diffusion-MU-Attack/fastargs/dict_utils.py:25
↓ 3 callersMethodrun_with_cache
Run the pipeline with caching at specified positions. This method allows you to cache the intermediate inputs and/or outputs of the
SAE/hooked_sd_noised_pipeline.py:117
↓ 2 callersMethod_denoise_loop
( self, timesteps, latents, guidance_scale, extra_step_kwargs,
SAE/hooked_sd_noised_pipeline.py:600
↓ 2 callersMethod_locate_block
Locate the block at the specified position in the pipeline.
SAE/hooked_sd_noised_pipeline.py:477
↓ 2 callersMethod_postprocess_latents
(self, latents, output_type, generator)
SAE/hooked_sd_noised_pipeline.py:643
↓ 2 callersMethod_prepare_prompt
( self, prompt, device, num_images_per_prompt, guidance_scale,
SAE/hooked_sd_noised_pipeline.py:542
↓ 2 callersFunctioncalculate_activation_statistics
Calculates the statistics used by FID Args: images: torch.tensor, shape: (N, 3, H, W), dtype: torch.float32 in range 0 - 1 batch_s
scripts/fid_unlearncanvas.py:110
↓ 2 callersFunctioncalculate_fid
Calculate FID between images1 and images2 Args: images1: np.array, shape: (N, H, W, 3), dtype: np.float32 between 0-1 or np.uint8
scripts/fid_unlearncanvas.py:237
↓ 2 callersMethodcollect_argparse_args
(self, parser, disable_help=False)
Diffusion-MU-Attack/fastargs/config.py:145
↓ 2 callersMethodcollect_config_file
(self, fname)
Diffusion-MU-Attack/fastargs/config.py:117
↓ 2 callersFunctionextract_function
(func)
Diffusion-MU-Attack/fastargs/decorators.py:45
↓ 2 callersMethodget_all_embedding
(self)
Diffusion-MU-Attack/src/tasks/utils/text_encoder.py:46
↓ 2 callersFunctionget_checker
(checker)
Diffusion-MU-Attack/fastargs/validation.py:15
↓ 2 callersFunctionget_dataset
(root_dir)
Diffusion-MU-Attack/src/attackers/utils/datasets.py:55
↓ 2 callersMethodget_loss
(self, x0, t, input_ids, input_embeddings, **kwargs)
Diffusion-MU-Attack/src/tasks/classifier_.py:310
↓ 2 callersFunctionget_percentile_threshold
Returns the threshold for the given percentile. Args: scores (torch.Tensor): 1D tensor of unnormalized scores, shape [num_features].
SAE/unlearning_utils.py:40
↓ 2 callersMethodimg2latent
(self, image)
Diffusion-MU-Attack/src/tasks/classifier_.py:340
↓ 2 callersMethodis_enabled
(self, config)
Diffusion-MU-Attack/fastargs/section.py:21
↓ 2 callersFunctionpreprocess_images
Resizes and shifts the dynamic range of image to 0-1 Args: images: np.array, shape: (N, H, W, 3), dtype: float32 between 0-1 or np.uint8
scripts/fid_unlearncanvas.py:210
↓ 2 callersMethodproject
(self,adv_embedding,task)
Diffusion-MU-Attack/src/attackers/hard_prompt_.py:116
↓ 2 callersMethodprojection
(self, curr_var, xi=1e-5)
Diffusion-MU-Attack/src/attackers/text_grad_.py:53
↓ 2 callersFunctionrecursive_get
(dic, path)
Diffusion-MU-Attack/fastargs/dict_utils.py:18
↓ 2 callersFunctionretrieve
(io, unconditional: bool = False)
SAE/hooked_sd_noised_pipeline.py:12
↓ 2 callersFunctionretrieve_timesteps
Calls the scheduler's `set_timesteps` method and retrieves timesteps from the scheduler after the call. Handles custom timesteps. Any kwargs
SAE/utils.py:21
↓ 2 callersMethodset_decoder_norm_to_unit_norm
(self)
SAE/sae.py:358
↓ 2 callersFunctionto_cuda
Transfers elements to cuda if GPU is available Args: elements: torch.tensor or torch.nn.module -- Returns: elemen
scripts/fid_unlearncanvas.py:25
↓ 2 callersMethodvalidate
(self, mode='stderr')
Diffusion-MU-Attack/fastargs/config.py:234
↓ 1 callersMethod__init__
(self, *checkers)
Diffusion-MU-Attack/fastargs/validation.py:67
↓ 1 callersMethod_consolidate_shards
Consolidate sharded datasets into a single directory without rewriting data. Each of the shards must be of the same format, aka the full data
SAE/cache_activations_runner_unlearn_canvas.py:107
↓ 1 callersMethod_create_shard
( self, buffer: torch.Tensor, # buffer shape: "bs num_inference_steps+1 d_sample_size d_in",
SAE/cache_activations_runner_unlearn_canvas.py:226
↓ 1 callersFunction_expand_mask
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
Diffusion-MU-Attack/src/tasks/utils/text_encoder.py:6
↓ 1 callersFunction_locate_block
Locate the block at the specified position in the pipeline.
Diffusion-MU-Attack/src/tasks/classifier_.py:164
↓ 1 callersFunction_make_causal_mask
Make causal mask used for bi-directional self-attention.
Diffusion-MU-Attack/src/tasks/utils/text_encoder.py:19
↓ 1 callersMethodadd_arg
(self, arg, alias)
Diffusion-MU-Attack/fastargs/decorators.py:9
↓ 1 callersMethodadd_entry
(self, ns, name, param)
Diffusion-MU-Attack/fastargs/config.py:27
↓ 1 callersMethodadd_section
(self, section)
Diffusion-MU-Attack/fastargs/config.py:24
↓ 1 callersMethodargmax_project
(self, adv_embedding, all_embeddings, tokenizer)
Diffusion-MU-Attack/src/attackers/text_grad_.py:194
↓ 1 callersMethodaugment_argparse
(self, parser)
Diffusion-MU-Attack/fastargs/config.py:57
↓ 1 callersMethodbackward
(ctx, grad_output)
SAE/kernels.py:411
↓ 1 callersMethodbisection
bisection method to find the root for the projection operation of $u$
Diffusion-MU-Attack/src/attackers/text_grad_.py:15
↓ 1 callersFunctioncalculate_frechet_distance
Numpy implementation of the Frechet Distance. The Frechet distance between two multivariate Gaussians X_1 ~ N(mu_1, C_1) and X_2 ~ N(mu_2, C_2
scripts/fid_unlearncanvas.py:128
↓ 1 callersMethodcollect_env_variables
(self)
Diffusion-MU-Attack/fastargs/config.py:140
↓ 1 callersMethodcollect_json
(self, fname)
Diffusion-MU-Attack/fastargs/config.py:126
↓ 1 callersMethodcollect_yaml
(self, fname)
Diffusion-MU-Attack/fastargs/config.py:132
↓ 1 callersMethodconstruct_embd
(self, adv_embedding)
Diffusion-MU-Attack/src/attackers/text_grad_.py:96
↓ 1 callersMethodconstruct_embd
(self,adv_embedding)
Diffusion-MU-Attack/src/attackers/hard_prompt_.py:44
↓ 1 callersMethodconstruct_id
(self, adv_id, sot_id, eot_id, mid_id)
Diffusion-MU-Attack/src/attackers/text_grad_.py:151
↓ 1 callersMethodconstruct_id
(self,adv_id,sot_id,eot_id,mid_id)
Diffusion-MU-Attack/src/attackers/random_.py:35
↓ 1 callersMethodconstruct_id
(self,adv_id,sot_id,eot_id,mid_id)
Diffusion-MU-Attack/src/attackers/hard_prompt_.py:79
↓ 1 callersMethodcreate_dataset_feature
(self, hook_name, d_in, d_out)
SAE/cache_activations_runner_unlearn_canvas.py:250
↓ 1 callersMethoddistribute_modules
Prepare a plan for distributing modules across ranks.
SAE/trainer.py:469
↓ 1 callersFunctionexpand_keys
(dic, prefix=tuple(), result=None)
Diffusion-MU-Attack/fastargs/dict_utils.py:35
↓ 1 callersFunctionfilter_dataset
(pd_data)
Diffusion-MU-Attack/src/tasks/utils/datasets.py:12
↓ 1 callersMethodfit
(self)
SAE/trainer.py:122
↓ 1 callersFunctiongeometric_median
Compute the geometric median `points`. Used for initializing decoder bias.
SAE/utils.py:149
↓ 1 callersFunctionget_activations
Calculates activations for last pool layer for all iamges -- Images: torch.array shape: (N, 3, 299, 299), dtype: torch.float32
scripts/fid_unlearncanvas.py:72
↓ 1 callersMethodget_all_config
(self, dump_path=None, ignore = [])
Diffusion-MU-Attack/fastargs/config.py:215
↓ 1 callersMethodget_batches
(items, batch_size)
SAE/cache_activations_runner_unlearn_canvas.py:94
↓ 1 callersFunctionget_transform
(interpolation=InterpolationMode.BICUBIC, size=512)
Diffusion-MU-Attack/src/attackers/utils/datasets.py:23
↓ 1 callersFunctionget_transform
(interpolation=InterpolationMode.BICUBIC, size=512)
Diffusion-MU-Attack/src/tasks/utils/datasets.py:30
↓ 1 callersMethodinit_adv
(self, task, orig_prompt_len)
Diffusion-MU-Attack/src/attackers/text_grad_.py:62
↓ 1 callersMethodinit_adv
(self, task, orig_prompt_len)
Diffusion-MU-Attack/src/attackers/hard_prompt_.py:20
↓ 1 callersMethodinit_attacker
(self, attacker)
Diffusion-MU-Attack/src/execs/attack.py:184
↓ 1 callersMethodinit_logger
(self, logger)
Diffusion-MU-Attack/src/execs/attack.py:190
next →1–100 of 337, ranked by callers