MCPcopy Create free account

hub / github.com/Luo-Yihong/TDM-R1 / functions

Functions127 in github.com/Luo-Yihong/TDM-R1

↓ 47 callersMethodto
(self, device: torch.device = None, dtype: torch.dtype = None)
flow_grpo/ema.py:82
↓ 11 callersFunctionpredict_v
修改后的函数:计算模型预测速度的对数概率。 保持输入参数不变。
scripts/train_tdmr1_pub.py:311
↓ 7 callersMethodsave
保存 EMA 参数到文件
flow_grpo/ema.py:114
↓ 6 callersMethodstep
(self, parameters: Iterable[torch.nn.Parameter], optimization_step, decay = None)
flow_grpo/ema.py:40
↓ 6 callersMethodupdate
(self, prompts, rewards, type='grpo')
flow_grpo/stat_tracking.py:11
↓ 5 callersFunction_load_lines
Load lines from a file. First tries to load from `path` directly, and if that doesn't exist, searches the `flow_grpo/assets` directory for a
flow_grpo/prompts.py:13
↓ 5 callersMethodcopy_ema_to
(self, parameters: Iterable[torch.nn.Parameter], store_temp: bool = True)
flow_grpo/ema.py:89
↓ 5 callersFunctionfrom_file
(path, low=None, high=None)
flow_grpo/prompts.py:27
↓ 4 callersFunctioncompressibility
()
config/tdmr1_clean.py:23
↓ 4 callersFunctioncompute_text_embeddings
(prompt, text_encoders, tokenizers, max_sequence_length, device)
scripts/train_tdmr1_pub.py:366
↓ 4 callersMethodload
从文件加载 EMA 参数
flow_grpo/ema.py:118
↓ 3 callersFunctionconvert
(x, s=7)
scripts/train_tdmr1_pub.py:53
↓ 3 callersMethodcopy_temp_to
(self, parameters: Iterable[torch.nn.Parameter])
flow_grpo/ema.py:97
↓ 3 callersFunctiongenerate_shared_timestep
跨 GPU 生成一个共享的 timestep,均匀分布在 [tmin, 1]。 Args: accelerator: Accelerator 对象 Returns: timestep: 标量 tensor,所有 GPU 上
scripts/train_tdmr1_pub.py:83
↓ 3 callersFunctioninv_convert
(y, s=7)
scripts/train_tdmr1_pub.py:56
↓ 2 callersMethod__init__
(self, dtype, device)
flow_grpo/hpsv2_scorer.py:86
↓ 2 callersFunction_canon
(name)
scripts/train_tdmr1_pub.py:618
↓ 2 callersMethodclear
(self)
flow_grpo/stat_tracking.py:67
↓ 2 callersFunctioncolor_classification
(image, bboxes, classname)
flow_grpo/gen_eval.py:110
↓ 2 callersFunctioncompute_geneval
(images, metadatas, only_strict=False)
flow_grpo/gen_eval.py:350
↓ 2 callersFunctiongenerate_shared_noise_for_groups
为每个 group 生成共享的噪声,跨 GPU 同步。 Args: x0: [batch_size, C, H, W] 用于获取形状 group_info: 预计算的 group 信息,包含 inverse_indices, num_gro
scripts/train_tdmr1_pub.py:183
↓ 2 callersFunctionget_all_linear_full_names
Return every nn.Linear module path in `model`.
scripts/train_tdmr1_pub.py:45
↓ 2 callersMethodget_stats
(self)
flow_grpo/stat_tracking.py:62
↓ 2 callersFunctionload_geneval
(DEVICE)
flow_grpo/gen_eval.py:26
↓ 2 callersMethodload_state_dict
(self, state_dict: dict)
flow_grpo/ema.py:103
↓ 2 callersFunctionpipeline_with_logprob
( self, prompt: Union[str, List[str]] = None, prompt_2: Optional[Union[str, List[str]]] = None,
flow_grpo/diffusers_patch/sd3_pipeline_tdmr1.py:11
↓ 2 callersFunctionrelative_position
Give position of A relative to B, factoring in object dimensions
flow_grpo/gen_eval.py:142
↓ 1 callersFunction_encode_prompt_with_clip
( text_encoder, tokenizer, prompt: str, device=None, text_input_ids=None, num_images_p
flow_grpo/diffusers_patch/train_dreambooth_lora_sd3.py:59
↓ 1 callersFunction_encode_prompt_with_t5
( text_encoder, tokenizer, max_sequence_length, prompt=None, num_images_per_prompt=1,
flow_grpo/diffusers_patch/train_dreambooth_lora_sd3.py:19
↓ 1 callersFunction_extract_scores
(text_outputs)
flow_grpo/rewards.py:454
↓ 1 callersFunction_get_hpsv3_scorer
Singleton-cached HPSv3 scorer (Qwen2-VL-7B based, expensive to construct). `device=None` defers GPU placement to the first `__call__` (loads on C
flow_grpo/rewards.py:25
↓ 1 callersFunction_load_source
(name, path)
config/tdmr1_clean.py:10
↓ 1 callersFunctioncalculate_zero_std_ratio
Calculate the proportion of unique prompts whose reward standard deviation is zero. Args: prompts: List of prompts. gath
scripts/train_tdmr1_pub.py:375
↓ 1 callersFunctioncompute_group_dgpo_loss_allreduce
AllReduce实现的梯度等价版本
scripts/train_tdmr1_pub.py:116
↓ 1 callersFunctioncompute_iou
(box_a, box_b)
flow_grpo/gen_eval.py:129
↓ 1 callersFunctioncreate_generator
(prompts, base_seed)
scripts/train_tdmr1_pub.py:411
↓ 1 callersFunctionencode_prompt
( text_encoders, tokenizers, prompt: str, max_sequence_length, device=None, num_images
flow_grpo/diffusers_patch/train_dreambooth_lora_sd3.py:98
↓ 1 callersFunctioneta_step_with_logprob
Predict the sample from the previous timestep by reversing the SDE. This function propagates the flow process from the learned model outputs
flow_grpo/diffusers_patch/sd3_sde_with_logprob.py:75
↓ 1 callersFunctioneval
(pipeline, test_dataloader, text_encoders, tokenizers, config, accelerator, global_step, reward_fn, executor,
scripts/train_tdmr1_pub.py:424
↓ 1 callersFunctionevaluate
Evaluate given image using detected objects on the global metadata specifications. Assumptions: * Metadata combines 'include'
flow_grpo/gen_eval.py:165
↓ 1 callersFunctionevaluate_batch_image
(images, prompts)
flow_grpo/rewards.py:494
↓ 1 callersFunctionevaluate_image
(prompt, image)
flow_grpo/rewards.py:470
↓ 1 callersFunctionevaluate_image
(image_pils, metadatas, only_strict)
flow_grpo/gen_eval.py:292
↓ 1 callersFunctionevaluate_reward
Evaluate given image using detected objects on the global metadata specifications. Assumptions: * Metadata combines 'include'
flow_grpo/gen_eval.py:227
↓ 1 callersFunctiongenerate_shared_sampled_timesteps
跨 GPU 生成共享的采样 timesteps。 Args: accelerator: Accelerator 对象 train_timesteps: 可采样的 timestep 列表 M: 要采样的数量
scripts/train_tdmr1_pub.py:59
↓ 1 callersMethodget_current_decay
(self, optimization_step)
flow_grpo/ema.py:33
↓ 1 callersFunctionimage_transform_tensor
( image_size: int, mean: tuple = None, std: tuple = None, fill_color: int = 0, )
flow_grpo/hpsv2_scorer.py:62
↓ 1 callersFunctionjpeg_incompressibility
()
flow_grpo/rewards.py:68
↓ 1 callersFunctionload_models
()
flow_grpo/gen_eval.py:43
↓ 1 callersFunctionmain
()
flow_grpo/rewards.py:629
↓ 1 callersFunctionmain
()
flow_grpo/hpsv2_scorer.py:134
↓ 1 callersFunctionmain
()
flow_grpo/stat_tracking.py:70
↓ 1 callersFunctionmain
()
flow_grpo/imagereward_scorer.py:30
↓ 1 callersFunctionmain
()
flow_grpo/pickscore_scorer.py:53
↓ 1 callersFunctionmulti_score
(device, score_dict)
flow_grpo/rewards.py:577
↓ 1 callersFunctionpil_image_to_base64
(image)
flow_grpo/rewards.py:447
↓ 1 callersFunctionprecompute_group_info
用 prompt_ids 预计算 group 信息(更快)
scripts/train_tdmr1_pub.py:158
↓ 1 callersFunctionsave_ckpt
(save_dir, transformer, global_step, accelerator, ema, transformer_trainable_parameters, config)
scripts/train_tdmr1_pub.py:592
↓ 1 callersFunctionsave_run_snapshot
Save script copy, resolved config JSON, argv, optional --config source file, and git metadata.
scripts/train_tdmr1_pub.py:535
↓ 1 callersMethodset_epoch
(self, epoch)
scripts/train_tdmr1_pub.py:308
↓ 1 callersFunctionsetup_lora_and_load_ema
Build the wide all-linear `tdm` LoRA and, when `config.train.lora_path` is set, remap a narrow (8 attn-projection) TDM LoRA EMA into it. Retur
scripts/train_tdmr1_pub.py:604
↓ 1 callersMethodstate_dict
(self)
flow_grpo/ema.py:108
↓ 1 callersFunctionunwrap_model
(model, accelerator)
scripts/train_tdmr1_pub.py:529
Method__call__
(self, images, prompts)
flow_grpo/hpsv2_scorer.py:123
Method__call__
Calculate OCR reward :param images: List of input images (PIL or numpy format) :param prompts: Corresponding target text list
flow_grpo/ocr.py:77
Method__call__
(self, prompts, images)
flow_grpo/imagereward_scorer.py:16
Method__call__
(self, prompt, images)
flow_grpo/pickscore_scorer.py:17
Method__getitem__
(self, idx)
scripts/train_tdmr1_pub.py:226
Method__getitem__
(self, idx)
scripts/train_tdmr1_pub.py:245
Method__getitem__
(self, index)
flow_grpo/gen_eval.py:96
Method__init__
(self, dataset, split='train')
scripts/train_tdmr1_pub.py:218
Method__init__
(self, dataset, split='train')
scripts/train_tdmr1_pub.py:236
Method__init__
(self, dataset, batch_size, k, num_replicas, rank, seed=0)
scripts/train_tdmr1_pub.py:255
Method__init__
( self, parameters: Iterable[torch.nn.Parameter], decay: float = 0.9999,
flow_grpo/ema.py:9
Method__init__
(self, max_size, interpolation=InterpolationMode.BICUBIC, fn="max", fill=0)
flow_grpo/hpsv2_scorer.py:17
Method__init__
(self, mean, std)
flow_grpo/hpsv2_scorer.py:43
Method__init__
(self, global_std=False)
flow_grpo/stat_tracking.py:6
Method__init__
OCR reward calculator :param use_gpu: Whether to use GPU acceleration for PaddleOCR
flow_grpo/ocr.py:47
Method__init__
(self, device="cuda", dtype=torch.float32)
flow_grpo/imagereward_scorer.py:7
Method__init__
(self, device="cuda", dtype=torch.float32)
flow_grpo/pickscore_scorer.py:6
Method__init__
(self, image: Image.Image, objects)
flow_grpo/gen_eval.py:84
Method__iter__
(self)
scripts/train_tdmr1_pub.py:268
Method__len__
(self)
scripts/train_tdmr1_pub.py:223
Method__len__
(self)
scripts/train_tdmr1_pub.py:242
Method__len__
(self)
flow_grpo/gen_eval.py:93
Function_fn
(images, prompts, metadata)
flow_grpo/rewards.py:12
Function_hpsv2_score_diff
(device)
flow_grpo/rewards.py:516
Function_paddleocr_init_lock
()
flow_grpo/ocr.py:13
Function_pickscore_score_diff
(device)
flow_grpo/rewards.py:527
Functionaesthetic_score
()
flow_grpo/rewards.py:92
Functionclip_score
(device)
flow_grpo/rewards.py:108
Methodcollate_fn
(examples)
scripts/train_tdmr1_pub.py:230
Methodcollate_fn
(examples)
scripts/train_tdmr1_pub.py:249
Functioncounting
(nouns_file, low, high)
flow_grpo/prompts.py:64
Functiondeqa_score_remote
Submits images to DeQA and computes a reward.
flow_grpo/rewards.py:218
Methodforward
(self, img)
flow_grpo/hpsv2_scorer.py:26
Methodforward
(self, tensor)
flow_grpo/hpsv2_scorer.py:47
Functiongeneral_ocr
()
flow_grpo/prompts.py:47
Functiongeneral_ocr_sd3_8gpu_G24_4step
()
config/tdmr1_clean.py:85
Functiongeneval_score
(device)
flow_grpo/rewards.py:267
next →1–100 of 127, ranked by callers