@@ -56,7 +56,7 @@ def __init__(self, signal_dim: Tuple[int],
5656 bn = kwargs .get ('batch_norm' , True )
5757 if self .downsample :
5858 signal_dim = [s // self .downsample for s in signal_dim ]
59- n = np .product (signal_dim )
59+ n = np .prod (signal_dim )
6060 self .reshape_ = nb_filters * n
6161 self .conv = ConvBlock (
6262 ndim , nb_layers , 1 , nb_filters ,
@@ -118,7 +118,7 @@ def __init__(self, signal_dim: Tuple[int],
118118 ndim = 2 if len (signal_dim ) == 2 else 1
119119 if self .upsampling :
120120 signal_dim = [s // 4 for s in signal_dim ]
121- n = np .product (signal_dim )
121+ n = np .prod (signal_dim )
122122 self .reshape_ = (nb_filters , * signal_dim )
123123 self .fc = nn .Linear (z_dim , nb_filters * n )
124124 if self .upsampling :
@@ -269,7 +269,7 @@ def __init__(self,
269269 self .conv = ConvBlock (
270270 dim , num_layers , c , hidden_dim ,
271271 lrelu_a = kwargs .get ("lrelu_a" , 0.1 ))
272- self .reshape_ = hidden_dim * np .product (in_dim [:2 ])
272+ self .reshape_ = hidden_dim * np .prod (in_dim [:2 ])
273273 self .fc11 = nn .Linear (self .reshape_ , latent_dim )
274274 self .fc12 = nn .Linear (self .reshape_ , latent_dim )
275275 self ._out = nn .Softplus () if kwargs .get ("softplus_out" ) else lambda x : x
@@ -323,7 +323,7 @@ def __init__(self,
323323 super (fcEncoderNet , self ).__init__ ()
324324 dense = []
325325 for i in range (num_layers ):
326- input_dim = np .product (in_dim ) if i == 0 else hidden_dim
326+ input_dim = np .prod (in_dim ) if i == 0 else hidden_dim
327327 dense .extend ([nn .Linear (input_dim , hidden_dim ), nn .Tanh ()])
328328 self .dense = nn .Sequential (* dense )
329329 self .reshape_ = hidden_dim
@@ -335,7 +335,7 @@ def forward(self, x: torch.Tensor):
335335 """
336336 Forward pass
337337 """
338- x = x .reshape (- 1 , np .product (x .size ()[1 :]))
338+ x = x .reshape (- 1 , np .prod (x .size ()[1 :]))
339339 x = self .dense (x )
340340 x = x .reshape (- 1 , self .reshape_ )
341341 z_mu = self .fc11 (x )
@@ -378,7 +378,7 @@ def __init__(self,
378378 super (jfcEncoderNet , self ).__init__ ()
379379 dense = []
380380 for i in range (num_layers ):
381- input_dim = np .product (in_dim ) if i == 0 else hidden_dim
381+ input_dim = np .prod (in_dim ) if i == 0 else hidden_dim
382382 dense .extend ([nn .Linear (input_dim , hidden_dim ), nn .Tanh ()])
383383 self .dense = nn .Sequential (* dense )
384384 self .reshape_ = hidden_dim
@@ -394,7 +394,7 @@ def forward(self, x: torch.Tensor):
394394 """
395395 Forward pass
396396 """
397- x = x .reshape (- 1 , np .product (x .size ()[1 :]))
397+ x = x .reshape (- 1 , np .prod (x .size ()[1 :]))
398398 x = self .dense (x )
399399 x = x .reshape (- 1 , self .reshape_ )
400400 encoded = [self .fc11 (x ), self ._out (self .fc12 (x ))]
@@ -446,7 +446,7 @@ def __init__(self,
446446 self .conv = ConvBlock (
447447 dim , num_layers , c , hidden_dim ,
448448 lrelu_a = kwargs .get ("lrelu_a" , 0.1 ))
449- self .reshape_ = hidden_dim * np .product (in_dim [:2 ])
449+ self .reshape_ = hidden_dim * np .prod (in_dim [:2 ])
450450 self .fc11 = nn .Linear (self .reshape_ , latent_dim )
451451 self .fc12 = nn .Linear (self .reshape_ , latent_dim )
452452 fc13 = []
@@ -501,7 +501,7 @@ def __init__(self,
501501 dim = 2 if len (out_dim ) > 1 else 1
502502 c = out_dim [- 1 ] if len (out_dim ) > 2 else 1
503503 self .fc_linear = nn .Linear (
504- latent_dim , hidden_dim * np .product (out_dim [:2 ]),
504+ latent_dim , hidden_dim * np .prod (out_dim [:2 ]),
505505 bias = False )
506506 self .reshape_ = (hidden_dim , * out_dim [:2 ])
507507 self .decoder = ConvBlock (
@@ -563,7 +563,7 @@ def __init__(self,
563563 hidden_dim_ = latent_dim if i == 0 else hidden_dim
564564 decoder .extend ([nn .Linear (hidden_dim_ , hidden_dim ), nn .Tanh ()])
565565 self .decoder = nn .Sequential (* decoder )
566- self .out = nn .Linear (hidden_dim , np .product (out_dim ))
566+ self .out = nn .Linear (hidden_dim , np .prod (out_dim ))
567567 self .out_dim = (c , * out_dim [:2 ])
568568
569569 def forward (self , z : torch .Tensor ) -> torch .Tensor :
0 commit comments