ls_mlkit.diffuser.conditioner package¶
Submodules¶
Module contents¶
- class ls_mlkit.diffuser.conditioner.Conditioner(guidance_scale: float = 1.0)[source]¶
Bases:
ABC- abstractmethod get_conditional_score(x_t: Tensor, t: Tensor, padding_mask: Tensor, *args: Any, **kwargs: Any) Tensor[source]¶
Get conditional score
- Parameters:
x_t (
Tensor) – the input tensort (
Tensor) – the time tensorpadding_mask (
Tensor) – the padding mask
- Returns:
the conditional score
- Return type:
Tensor
- property guidance_scale¶
- abstractmethod prepare_condition_dict(train: bool = True, *args: list[Any], **kwargs: dict[Any, Any]) dict[str, Any][source]¶
Prepare the condition dictionary
- Parameters:
train (
bool, optional) – whether the conditioner is used in training. Defaults to True.- Returns:
the condition dictionary
- Return type:
dict[str, Any]
- abstractmethod set_condition(*args: list[Any], **kwargs: dict[Any, Any]) None[source]¶
Set the condition
- Parameters:
*args – additional arguments
**kwargs – additional keyword arguments
- property set_guidance_scale¶
- class ls_mlkit.diffuser.conditioner.LGDConditioner(guidance_scale: float = 1.0)[source]¶
Bases:
ConditionerLoss Guidance Conditioner