Diffusers documentation

활성화 함수

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

활성화 함수

🤗 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) — 선형 레이어에 bias를 사용할지 여부.

approximate="tanh"로 tanh 근사 지원을 하는 GELU 활성화 함수.

GEGLU

class diffusers.models.activations.GEGLU

< >

( dim_in: intdim_out: intbias: bool = True )

매개변수

  • dim_in (int) — 입력의 채널 수.
  • dim_out (int) — 출력의 채널 수.
  • bias (bool, 기본값 True) — 선형 레이어에 bias를 사용할지 여부.

게이트드 리니어 유닛 활성화 함수의 변형입니다.

ApproximateGELU

class diffusers.models.activations.ApproximateGELU

< >

( dim_in: intdim_out: intbias: bool = True )

매개변수

  • dim_in (int) — 입력의 채널 수.
  • dim_out (int) — 출력의 채널 수.
  • bias (bool, 기본값 True) — 선형 레이어에 bias를 사용할지 여부.

가우시안 에러 리니어 유닛(GELU)의 근사 형태. 자세한 내용은 이 논문의 2절을 참고하세요.

SwiGLU

class diffusers.models.activations.SwiGLU

< >

( dim_in: intdim_out: intbias: bool = True )

매개변수

  • dim_in (int) — 입력의 채널 수.
  • dim_out (int) — 출력의 채널 수.
  • bias (bool, 기본값 True) — 선형 레이어에 bias를 사용할지 여부.

게이트드 리니어 유닛 활성화 함수의 변형입니다. GEGLU와 유사하지만 GeLU 대신 SiLU / Swish를 사용합니다.

FP32SiLU

클래스 diffusers.models.activations.FP32SiLU

< >

( )

입력이 torch.float32로 업캐스트된 SiLU 활성화 함수.

LinearActivation

class diffusers.models.activations.LinearActivation

< >

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

Update on GitHub