File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 3131from .modules import (
3232 AutoEncoder1d ,
3333 MultiEncoder1d ,
34+ Noiser ,
3435 T5Embedder ,
3536 Tanh ,
3637 UNet1d ,
Original file line number Diff line number Diff line change @@ -1350,6 +1350,20 @@ def forward(
13501350 return (x , info ) if with_info else x
13511351
13521352
1353+ class Noiser (Bottleneck ):
1354+ def __init__ (self , sigma : float = 1.0 ):
1355+ super ().__init__ ()
1356+ self .sigma = sigma
1357+
1358+ def forward (
1359+ self , x : Tensor , with_info : bool = False
1360+ ) -> Union [Tensor , Tuple [Tensor , Any ]]:
1361+ if self .training :
1362+ x = torch .randn_like (x ) * self .sigma + x
1363+ info : Dict = dict ()
1364+ return (x , info ) if with_info else x
1365+
1366+
13531367class AutoEncoder1d (nn .Module ):
13541368 def __init__ (
13551369 self ,
Original file line number Diff line number Diff line change 33setup (
44 name = "audio-diffusion-pytorch" ,
55 packages = find_packages (exclude = []),
6- version = "0.0.71 " ,
6+ version = "0.0.72 " ,
77 license = "MIT" ,
88 description = "Audio Diffusion - PyTorch" ,
99 long_description_content_type = "text/markdown" ,
You can’t perform that action at this time.
0 commit comments