SYMBOL INDEX (211 symbols across 38 files) FILE: spo_training_and_inference/configs/basic_config.py function get_config (line 3) | def get_config(): function basic_config (line 6) | def basic_config(): FILE: spo_training_and_inference/configs/spo_sd-v1-5_4k-prompts_num-sam-4_10ep_bs10.py function get_config (line 3) | def get_config(): function exp_config (line 6) | def exp_config(): FILE: spo_training_and_inference/configs/spo_sdxl_4k-prompts_num-sam-2_3-is_10ep_bs2_gradacc2.py function get_config (line 3) | def get_config(): function exp_config (line 6) | def exp_config(): FILE: spo_training_and_inference/inference_scripts/inference_spo_sd-v1-5.py function main (line 14) | def main(): FILE: spo_training_and_inference/inference_scripts/inference_spo_sdxl.py function main (line 14) | def main(): FILE: spo_training_and_inference/spo/custom_diffusers/ddim_seperate.py function _left_broadcast (line 9) | def _left_broadcast(t, shape): function _get_variance (line 13) | def _get_variance(self, timestep, prev_timestep): function ddim_step_fetch_x0 (line 25) | def ddim_step_fetch_x0( function ddim_step_fetch_x_t_1 (line 90) | def ddim_step_fetch_x_t_1( FILE: spo_training_and_inference/spo/custom_diffusers/ddim_with_logprob.py function _left_broadcast (line 9) | def _left_broadcast(t, shape): function _get_variance (line 13) | def _get_variance(self, timestep, prev_timestep): function ddim_step_with_logprob (line 25) | def ddim_step_with_logprob( FILE: spo_training_and_inference/spo/custom_diffusers/multi_sample_pipeline.py function multi_sample_pipeline (line 13) | def multi_sample_pipeline( FILE: spo_training_and_inference/spo/custom_diffusers/multi_sample_pipeline_sdxl.py function multi_sample_pipeline_sdxl (line 20) | def multi_sample_pipeline_sdxl( FILE: spo_training_and_inference/spo/datasets/builder.py function build_dataset (line 5) | def build_dataset(cfg): FILE: spo_training_and_inference/spo/datasets/prompt_dataset.py class PromptDataset (line 13) | class PromptDataset(Dataset): method __init__ (line 14) | def __init__(self, meta_json_path, pretrained_tokenzier_path, caption_... method __len__ (line 23) | def __len__(self): method __getitem__ (line 26) | def __getitem__(self, idx): method collate_fn (line 45) | def collate_fn(examples, tokenizer): method sdxl_collate_fn (line 67) | def sdxl_collate_fn(examples, tokenizer, tokenizer_2): FILE: spo_training_and_inference/spo/preference_models/builder.py function get_compare_func (line 7) | def get_compare_func(compare_func_cfg): function get_preference_model_func (line 14) | def get_preference_model_func(cfg, device): FILE: spo_training_and_inference/spo/preference_models/compare_funcs.py function preference_score_compare (line 5) | def preference_score_compare(scores, threshold): FILE: spo_training_and_inference/spo/preference_models/models/step_aware_preference_model.py class StepAwarePreferenceModel (line 14) | class StepAwarePreferenceModel(nn.Module): method __init__ (line 15) | def __init__( method get_text_features (line 52) | def get_text_features(self, *args, **kwargs): method get_image_features (line 55) | def get_image_features(self, *args, **kwargs): method forward (line 58) | def forward(self, text_inputs=None, image_inputs=None, time_cond=None): method logit_scale (line 67) | def logit_scale(self): method get_preference_score (line 70) | def get_preference_score(self, images, input_ids, timesteps): FILE: spo_training_and_inference/spo/preference_models/models/time_conditioned_clip.py function modulate (line 31) | def modulate(x, shift, scale): class TimeConditionedCLIPEncoderLayer (line 35) | class TimeConditionedCLIPEncoderLayer(CLIPEncoderLayer): method __init__ (line 36) | def __init__(self, config: CLIPConfig): method forward (line 58) | def forward( class TimeConditionedCLIPEncoder (line 106) | class TimeConditionedCLIPEncoder(CLIPEncoder): method __init__ (line 107) | def __init__(self, config: CLIPConfig): method forward (line 113) | def forward( class TimeConditionedCLIPVisionTransformer (line 204) | class TimeConditionedCLIPVisionTransformer(CLIPVisionTransformer): method __init__ (line 205) | def __init__(self, config: CLIPVisionConfig): method forward (line 223) | def forward( class TimestepEmbedder (line 273) | class TimestepEmbedder(nn.Module): method __init__ (line 277) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 287) | def timestep_embedding(t, dim, max_period=10000): method forward (line 307) | def forward(self, t): class HFTimeConditionedCLIPModel (line 314) | class HFTimeConditionedCLIPModel(CLIPModel): method __init__ (line 315) | def __init__(self, config: CLIPConfig): method get_image_features (line 354) | def get_image_features( method forward (line 411) | def forward( FILE: spo_training_and_inference/spo/preference_models/preference_model_fns.py function step_aware_preference_model_func_builder (line 7) | def step_aware_preference_model_func_builder(cfg): FILE: spo_training_and_inference/spo/utils/dist_utils.py function gather_tensor_with_diff_shape (line 4) | def gather_tensor_with_diff_shape(input_tensor, primary_dim_size_list): FILE: spo_training_and_inference/train_scripts/train_spo.py function main (line 58) | def main(_): FILE: spo_training_and_inference/train_scripts/train_spo_sdxl.py function main (line 58) | def main(_): FILE: step_aware_preference_model/trainer/accelerators/base_accelerator.py function debug (line 28) | def debug(port): class DebugConfig (line 35) | class DebugConfig: class TrainingMode (line 40) | class TrainingMode(BaseEnum): class MetricMode (line 45) | class MetricMode(BaseEnum): class BaseAcceleratorConfig (line 51) | class BaseAcceleratorConfig: class BaseAccelerator (line 75) | class BaseAccelerator(abc.ABC): method __init__ (line 77) | def __init__(self, cfg: BaseAcceleratorConfig): method post_init (line 91) | def post_init(self): method set_logging_level (line 97) | def set_logging_level(self): method debug (line 105) | def debug(self): method set_seed (line 109) | def set_seed(self): method prepare (line 113) | def prepare(self, *args, device_placement=None): method get_latest_checkpoint (line 116) | def get_latest_checkpoint(self): method load_state_if_needed (line 125) | def load_state_if_needed(self): method is_main_process (line 143) | def is_main_process(self): method num_processes (line 147) | def num_processes(self): method pre_training_log (line 150) | def pre_training_log(self, cfg: DictConfig): method init_training (line 165) | def init_training(self, cfg: DictConfig): method should_skip (line 184) | def should_skip(self, epoch, step): method update_progbar_step (line 193) | def update_progbar_step(self): method log (line 196) | def log(self, data): method recalc_train_length_after_prepare (line 200) | def recalc_train_length_after_prepare(self, num_batches): method accumulate (line 208) | def accumulate(self, model): method gather (line 211) | def gather(self, data): method sync_gradients (line 215) | def sync_gradients(self): method update_step_loss (line 218) | def update_step_loss(self, loss): method update_global_step (line 221) | def update_global_step(self, loss): method get_allocated_cuda_memory (line 231) | def get_allocated_cuda_memory(self): method update_step (line 234) | def update_step(self, loss, lr): method wait_for_everyone (line 249) | def wait_for_everyone(self): method update_epoch (line 252) | def update_epoch(self): method update_metrics (line 259) | def update_metrics(self, metrics): method end_training (line 264) | def end_training(self): method unwrap_and_save (line 268) | def unwrap_and_save(self, model): method should_end (line 278) | def should_end(self): method backward (line 281) | def backward(self, loss): method clip_grad_norm_ (line 284) | def clip_grad_norm_(self, params): method should_eval (line 287) | def should_eval(self): method should_save (line 296) | def should_save(self): method training_stage (line 300) | def training_stage(self): method save_training_stage (line 310) | def save_training_stage(self, save_dir): method save_checkpoint (line 313) | def save_checkpoint(self): method gradient_state (line 334) | def gradient_state(self): method get_all_ckpts (line 337) | def get_all_ckpts(self): method load_best_checkpoint (line 340) | def load_best_checkpoint(self): method device (line 362) | def device(self): method cleanup_checkpoints (line 365) | def cleanup_checkpoints(self): method get_ckpts_to_delete (line 384) | def get_ckpts_to_delete(self): FILE: step_aware_preference_model/trainer/accelerators/debug_accelerator.py class DebugAcceleratorConfig (line 7) | class DebugAcceleratorConfig(BaseAcceleratorConfig): class DebugAccelerator (line 11) | class DebugAccelerator(BaseAccelerator): method __init__ (line 12) | def __init__(self, cfg: DebugAcceleratorConfig): FILE: step_aware_preference_model/trainer/accelerators/deepspeed_accelerator.py class MixedPrecisionConfig (line 14) | class MixedPrecisionConfig: class DeepSpeedConfig (line 19) | class DeepSpeedConfig: class DeepSpeedAcceleratorConfig (line 59) | class DeepSpeedAcceleratorConfig(BaseAcceleratorConfig): class DeepSpeedAccelerator (line 67) | class DeepSpeedAccelerator(BaseAccelerator): method __init__ (line 68) | def __init__(self, cfg: DeepSpeedAcceleratorConfig): method set_mixed_precision (line 86) | def set_mixed_precision(self): method prepare (line 97) | def prepare(self, *args, device_placement=None): FILE: step_aware_preference_model/trainer/accelerators/utils.py function nvidia_smi_gpu_memory_stats (line 12) | def nvidia_smi_gpu_memory_stats(): function get_nvidia_smi_gpu_memory_stats_str (line 42) | def get_nvidia_smi_gpu_memory_stats_str(): function print_config (line 46) | def print_config(cfg: DictConfig): function _flatten_dict (line 60) | def _flatten_dict(params: MutableMapping, delimiter: str = "/", parent_k... FILE: step_aware_preference_model/trainer/configs/configs.py function _locate (line 18) | def _locate(path: str) -> Any: function instantiate_with_cfg (line 72) | def instantiate_with_cfg(cfg: DictConfig, **kwargs): class DebugConfig (line 89) | class DebugConfig: class TrainerConfig (line 95) | class TrainerConfig: FILE: step_aware_preference_model/trainer/criterions/spm_criterion.py class SPMCriterionConfig (line 8) | class SPMCriterionConfig: class SPMCriterion (line 23) | class SPMCriterion(_Loss): method __init__ (line 24) | def __init__(self, cfg: SPMCriterionConfig): method get_features (line 29) | def get_features( method gather_features (line 49) | def gather_features(features): method calc_loss (line 53) | def calc_loss( method forward (line 134) | def forward(self, model, batch): FILE: step_aware_preference_model/trainer/datasetss/base_dataset.py class BaseDatasetConfig (line 7) | class BaseDatasetConfig: class BaseDataset (line 16) | class BaseDataset(torch.utils.data.Dataset): FILE: step_aware_preference_model/trainer/datasetss/pick_a_pic_spm_dataset.py function general_collate (line 29) | def general_collate(batch, column_name): class ProcessorConfig (line 36) | class ProcessorConfig: class PickaPicSPMDatasetConfig (line 42) | class PickaPicSPMDatasetConfig(BaseDatasetConfig): class PickaPicSPMDataset (line 92) | class PickaPicSPMDataset(BaseDataset): method __init__ (line 94) | def __init__(self, cfg: PickaPicSPMDatasetConfig, split: str = "train"): method load_hf_dataset (line 190) | def load_hf_dataset(self, split: str) -> Dataset: method tokenize (line 202) | def tokenize(self, example): method process_image (line 213) | def process_image(self, image): method __getitem__ (line 224) | def __getitem__(self, idx): method collate_fn (line 292) | def collate_fn(self, batch): method __len__ (line 330) | def __len__(self): FILE: step_aware_preference_model/trainer/lr_schedulers/constant_with_warmup.py class ConstantWithWarmupLRSchedulerConfig (line 8) | class ConstantWithWarmupLRSchedulerConfig: function instantiate_dummy_lr_scheduler (line 15) | def instantiate_dummy_lr_scheduler(cfg: ConstantWithWarmupLRSchedulerCon... FILE: step_aware_preference_model/trainer/lr_schedulers/dummy_lr_scheduler.py class DummyLRSchedulerConfig (line 17) | class DummyLRSchedulerConfig: function instantiate_dummy_lr_scheduler (line 24) | def instantiate_dummy_lr_scheduler(cfg: DummyLRSchedulerConfig, optimizer): FILE: step_aware_preference_model/trainer/models/base_model.py class BaseModelConfig (line 6) | class BaseModelConfig: FILE: step_aware_preference_model/trainer/models/step_aware_preference_model.py class StepAwarePreferenceModelConfig (line 11) | class StepAwarePreferenceModelConfig(BaseModelConfig): class StepAwarePreferenceModel (line 18) | class StepAwarePreferenceModel(nn.Module): method __init__ (line 19) | def __init__(self, cfg: StepAwarePreferenceModelConfig): method get_text_features (line 26) | def get_text_features(self, *args, **kwargs): method get_image_features (line 29) | def get_image_features(self, *args, **kwargs): method forward (line 32) | def forward(self, text_inputs=None, image_inputs=None, time_cond=None): method init_adaln_paras (line 40) | def init_adaln_paras(self): method logit_scale (line 59) | def logit_scale(self): method save (line 62) | def save(self, path): FILE: step_aware_preference_model/trainer/models/time_conditioned_clip.py function modulate (line 31) | def modulate(x, shift, scale): class TimeConditionedCLIPEncoderLayer (line 35) | class TimeConditionedCLIPEncoderLayer(CLIPEncoderLayer): method __init__ (line 36) | def __init__(self, config: CLIPConfig): method forward (line 58) | def forward( class TimeConditionedCLIPEncoder (line 106) | class TimeConditionedCLIPEncoder(CLIPEncoder): method __init__ (line 107) | def __init__(self, config: CLIPConfig): method forward (line 113) | def forward( class TimeConditionedCLIPVisionTransformer (line 204) | class TimeConditionedCLIPVisionTransformer(CLIPVisionTransformer): method __init__ (line 205) | def __init__(self, config: CLIPVisionConfig): method forward (line 223) | def forward( class TimestepEmbedder (line 273) | class TimestepEmbedder(nn.Module): method __init__ (line 277) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 287) | def timestep_embedding(t, dim, max_period=10000): method forward (line 307) | def forward(self, t): class HFTimeConditionedCLIPModel (line 314) | class HFTimeConditionedCLIPModel(CLIPModel): method __init__ (line 315) | def __init__(self, config: CLIPConfig): method get_image_features (line 354) | def get_image_features( method forward (line 411) | def forward( FILE: step_aware_preference_model/trainer/optimizers/adamw.py class AdamWOptimizerConfig (line 5) | class AdamWOptimizerConfig: FILE: step_aware_preference_model/trainer/optimizers/dummy_optimizer.py class DummyOptimizerConfig (line 6) | class DummyOptimizerConfig: class BaseDummyOptim (line 14) | class BaseDummyOptim(DummyOptim): method __init__ (line 15) | def __init__(self, model, lr=0.001, weight_decay=0, **kwargs): FILE: step_aware_preference_model/trainer/scripts/train_spm.py function load_dataloaders (line 20) | def load_dataloaders(cfg: DictConfig) -> Any: function load_optimizer (line 35) | def load_optimizer(cfg: DictConfig, model: nn.Module): function load_scheduler (line 40) | def load_scheduler(cfg: DictConfig, optimizer): function load_task (line 45) | def load_task(cfg: DictConfig, accelerator: BaseAccelerator): function verify_or_write_config (line 50) | def verify_or_write_config(cfg: TrainerConfig): function main (line 63) | def main(cfg: TrainerConfig) -> None: FILE: step_aware_preference_model/trainer/tasks/base_task.py function flatten (line 11) | def flatten(list_of_lists): class BaseTaskConfig (line 16) | class BaseTaskConfig: class BaseTask (line 21) | class BaseTask: method __init__ (line 23) | def __init__(self, cfg: BaseTaskConfig, accelerator): method train_step (line 27) | def train_step(self, model, criterion, batch): method valid_step (line 30) | def valid_step(self, model, criterion, batch): method evaluate (line 33) | def evaluate(self, model, criterion, dataloader): method log_to_wandb (line 36) | def log_to_wandb(self, eval_dict, table_name="test_predictions"): method gather_iterable (line 55) | def gather_iterable(it, num_processes): method valid_step (line 61) | def valid_step(self, model, criterion, batch): method gather_dict (line 65) | def gather_dict(self, eval_dict): FILE: step_aware_preference_model/trainer/tasks/spm_task.py function numpy_to_pil (line 31) | def numpy_to_pil(images): class SPMTaskConfig (line 37) | class SPMTaskConfig(BaseTaskConfig): class SPMTask (line 69) | class SPMTask(BaseTask): method __init__ (line 70) | def __init__(self, cfg: SPMTaskConfig, accelerator: BaseAccelerator): method train_step (line 173) | def train_step(self, model, criterion, batch): method features2probs (line 218) | def features2probs(model, text_features, image_0_features, image_1_fea... method valid_step (line 229) | def valid_step(self, model, criterion, batch): method pixel_values_to_pil_images (line 240) | def pixel_values_to_pil_images(pixel_values): method run_inference (line 246) | def run_inference(self, model, criterion, dataloader, t): method evaluate (line 307) | def evaluate(self, model, criterion, dataloader): method get_noised_imgs (line 320) | def get_noised_imgs(self, batch, timesteps): method update_as_pickscore_label (line 424) | def update_as_pickscore_label(self, batch, threshold=0.1): method sdxl_encode_prompt_embeds (line 485) | def sdxl_encode_prompt_embeds(text_encoders, text_input_ids_list): FILE: step_aware_preference_model/trainer/utils/batchable_ddim_scheduler.py class BatchableDDIMScheduler (line 11) | class BatchableDDIMScheduler(DDIMScheduler): method _get_variance (line 12) | def _get_variance(self, timestep, prev_timestep): method step (line 25) | def step(