Diffusers documentation
RFD4ProteinaScheduler
RFD4ProteinaScheduler
RFD4ProteinaScheduler は、RFD4-Proteína の単一モダリティ向け temporal-score-rescaled flow sampler です。このパイプラインでは 2 つのインスタンスを使用します。1 つはバックボーン(bb_ca、座標はナノメートル単位)用、もう 1 つはトークンごとのローカル潜在変数(local_latents)用です。それぞれに独自の時間スケジュール、ノイズスケジュール、リスケールが適用されます。サンプリングループの詳細は RFD4ProteinaPipeline を参照してください。
RFD4ProteinaScheduler
class diffusers.RFD4ProteinaScheduler
< source >( schedule_mode: strnoise_mode: strtsr_k: floattsr_sigma: floattail_steps: int = 10tail_step_multiplier: int = 2t_lim_ode: float = 0.95t_lim_ode_below: float = 0.02 )
パラメータ
- schedule_mode (
str) — ノイズとデータの間の時間の間隔:"log"または"power"。 - noise_mode (
str) — 確率的ウィンドウに注入されるノイズの形状:"1/t"または"tan"。 - tsr_k (
float) — サンプリング温度がどの程度まで低下するかを示します。値が大きいほど、温度は低くなります。 - tsr_sigma (
float) — 低温に到達する速さを指定します。値が大きいほど速くなります。 - tail_steps (
int、デフォルトは10) —tail_step_multiplierによって、他の区間よりも細かくされる最後の区間の数。 - tail_step_multiplier (
int、デフォルトは2) — 最終区間をどの程度細かくするかを示します。 - t_lim_ode (
float、デフォルト値は0.95) — この時刻を超えると、ステップは決定論的になります。 - t_lim_ode_below (
float、デフォルト値は0.02) — この時間より小さい場合、ステップは決定論的になります。
RFD4-Proteínaの1つのモダリティ用の、時間スコアを再スケーリングしたフローサンプラー。
このパイプラインは、バックボーンとトークンごとのローカル潜在変数の2つのモダリティを統合しており、それぞれに1つのスケジューラを使用します。これらは、時間スケジューリング、ノイズスケジューリング、およびリスケールにおいて異なります。
サンプリングの前にset_timestepsを呼び出してください。時刻はノイズからクリーンなデータに向かって増加します。スケジューラは現在の区間を追跡するため、並行して生成を行う場合は共有しないでください。
set_timesteps
< source >( num_inference_steps: intdevice: typing.Union[str, torch.device, NoneType] = Nonestart_time: float | None = None )
スケジュールを解決し、統合カーソルをリセットします。
add_noise
< source >( original_samples: Tensornoise: Tensortimesteps: typing.Union[float, torch.Tensor] )
前方周辺分布 (1 - t) * noise + t * clean をサンプリングします。
ステップ
< source >( model_output: Tensortimestep: Tensorsample: Tensoremit_mask: Tensorgenerator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = Nonereturn_dict: bool = True ) → RFD4ProteinaSchedulerOutput or tuple
パラメータ
- model_output (
torch.Tensor) —sampleと同じ形状の予測速度。 - timestep (
torch.Tensor) —timestepsの次の要素です。順序が異なるステップは拒否されます。 - sample (
torch.Tensor) — 現在の状態(B, N, D)。 - emit_mask (
torch.Tensor) —(B, N)のブール値。更新されるトークン(コンテキストやパディング以外)が true です。 - generator (
torch.Generatorまたはlist[torch.Generator]、省略可) — 単一の行用のジェネレーター、またはバッチの各行ごとに異なるジェネレーターを指定します。省略した場合、グローバルストリームが使用されます。 - return_dict (
bool、デフォルトはTrue) —RFD4ProteinaSchedulerOutputを返します。それ以外の場合は、状態を保持する1要素のタプルを返します。
戻り値
RFD4ProteinaSchedulerOutput または tuple
更新された状態。
1つの積分区間を進め、step_indexを更新します。
RFD4ProteinaSchedulerOutput
class diffusers.schedulers.scheduling_rfd4_proteina.RFD4ProteinaSchedulerOutput
< source >( prev_sample: Tensor )
1つのモダリティの更新後の状態。