Diffusers documentation

Fungsi aktivasi

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Fungsi aktivasi

Fungsi aktivasi yang dikustomisasi untuk mendukung berbagai model di πŸ€— Diffusers.

GELU

kelas diffusers.models.activations.GELU

< >

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

Parameter

  • dim_in (int) β€” Jumlah channel pada input.
  • dim_out (int) β€” Jumlah channel pada output.
  • approximate (str, opsional, default "none") β€” Jika "tanh", gunakan aproksimasi tanh.
  • bias (bool, defaultnya True) β€” Apakah akan menggunakan bias pada linear layer.

Fungsi aktivasi GELU dengan dukungan aproksimasi tanh menggunakan approximate="tanh".

GEGLU

kelas diffusers.models.activations.GEGLU

< >

( dim_in: intdim_out: intbias: bool = True )

Parameter

  • dim_in (int) β€” Jumlah channel pada input.
  • dim_out (int) β€” Jumlah channel pada output.
  • bias (bool, defaultnya True) β€” Apakah akan menggunakan bias pada linear layer.

Sebuah varian dari fungsi aktivasi gated linear unit.

ApproximateGELU

kelas diffusers.models.activations.ApproximateGELU

< >

( dim_in: intdim_out: intbias: bool = True )

Parameter

  • dim_in (int) β€” Jumlah channel pada input.
  • dim_out (int) β€” Jumlah channel pada output.
  • bias (bool, defaultnya True) β€” Apakah akan menggunakan bias pada linear layer.

Bentuk aproksimasi dari Gaussian Error Linear Unit (GELU). Untuk detail lebih lanjut, lihat bagian 2 dari makalah ini.

SwiGLU

kelas diffusers.models.activations.SwiGLU

< >

( dim_in: intdim_out: intbias: bool = True )

Parameter

  • dim_in (int) β€” Jumlah channel pada input.
  • dim_out (int) β€” Jumlah channel pada output.
  • bias (bool, defaultnya True) β€” Apakah akan menggunakan bias pada linear layer.

Sebuah varian dari fungsi aktivasi gated linear unit. Mirip dengan GEGLU tetapi menggunakan SiLU / Swish alih-alih GeLU.

FP32SiLU

kelas diffusers.models.activations.FP32SiLU

< >

( )

Fungsi aktivasi SiLU dengan input yang di-upcast ke torch.float32.

LinearActivation

kelas diffusers.models.activations.LinearActivation

< >

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

Update on GitHub