Diffusers documentation

活性化関数

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

活性化関数

🤗 Diffusersでさまざまなモデルをサポートするためのカスタマイズされた活性化関数。

GELU

クラス diffusers.models.activations.GELU

< >

( dim_in: intdim_out: intapproximate: str = 'none'bias: bool = True )

パラメータ

  • dim_in (int) — 入力チャネル数。
  • dim_out (int) — 出力のチャネル数。
  • approximate (str、任意、デフォルトは"none") — "tanh"の場合、tanh近似を使用します。
  • bias (bool, デフォルトは True) — 線形層でバイアスを使用するかどうか。

approximate="tanh" による tanh 近似をサポートする GELU 活性化関数。

GEGLU

クラス diffusers.models.activations.GEGLU

< >

( dim_in: intdim_out: intbias: bool = True )

パラメータ

  • dim_in (int) — 入力チャネル数。
  • dim_out (int) — 出力のチャネル数。
  • bias (bool, デフォルトは True) — 線形層でバイアスを使用するかどうか。

ゲート付き線形ユニット活性化関数のバリアント。

ApproximateGELU

クラス diffusers.models.activations.ApproximateGELU

< >

( dim_in: intdim_out: intbias: bool = True )

パラメータ

  • dim_in (int) — 入力チャネル数。
  • dim_out (int) — 出力のチャネル数。
  • bias (bool, デフォルトは True) — 線形層でバイアスを使用するかどうか。

ガウス誤差線形ユニット(GELU)の近似形です。詳細については、この論文のセクション2を参照してください。

SwiGLU

クラス diffusers.models.activations.SwiGLU

< >

( dim_in: intdim_out: intbias: bool = True )

パラメータ

  • dim_in (int) — 入力チャネル数。
  • dim_out (int) — 出力のチャネル数。
  • bias (bool, デフォルトは True) — 線形層でバイアスを使用するかどうか。

ゲート付き線形ユニット活性化関数のバリアントです。GEGLUに似ていますが、GeLUの代わりにSiLU / Swishを使用します。

FP32SiLU

クラス diffusers.models.activations.FP32SiLU

< >

( )

入力をtorch.float32にキャストしたSiLU活性化関数。

LinearActivation

クラス diffusers.models.activations.LinearActivation

< >

( dim_in: intdim_out: intbias: bool = Trueactivation: str = 'silu' )

Update on GitHub