vlbthambawita commited on
Commit
0dd039e
1 Parent(s): 95201e6

Upload DeepFakeECGFromPulse2Pulse

Browse files
Files changed (1) hide show
  1. modeling_deepfake.py +12 -3
modeling_deepfake.py CHANGED
@@ -285,8 +285,17 @@ class DeepFakeECGFromPulse2Pulse(PreTrainedModel):
285
  latent_dim=100, post_proc_filt_len=512,
286
  verbose=False, upsample=True)
287
 
288
- def forward(self, tensor, labels=None):
289
- x = self.model(tensor)
290
 
291
- return {"x": x}
 
 
 
 
 
 
 
 
 
 
292
 
 
285
  latent_dim=100, post_proc_filt_len=512,
286
  verbose=False, upsample=True)
287
 
288
+ def forward(self, num_samples, labels=None):
 
289
 
290
+ outputs = []
291
+
292
+ for i in range(num_samples):
293
+ noise = torch.Tensor(1, 8, 5000).uniform_(-1, 1)
294
+ x = self.model(noise)
295
+ x = x*6000
296
+ x = x.int()
297
+ x = torch.t(x.squeeze())
298
+ outputs.append(x)
299
+
300
+ return outputs
301