Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Fix bug in test part, will improve BER for at least 0.5~1dB.
  • Loading branch information
yihanjiang authored Mar 16, 2022
1 parent 911d9d1 commit 80b2934
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def test(model, args, block_len = 'default',use_cuda = False):
num_test_batch = int(args.num_block/(args.batch_size))
for batch_idx in range(num_test_batch):
X_test = torch.randint(0, 2, (args.batch_size, block_len, args.code_rate_k), dtype=torch.float)
fwd_noise = generate_noise(X_test.shape, args, test_sigma=sigma)
noise_shape = (args.batch_size, args.block_len, args.code_rate_n)
fwd_noise = generate_noise(noise_shape, args, test_sigma=sigma)

X_test, fwd_noise= X_test.to(device), fwd_noise.to(device)

Expand Down

0 comments on commit 80b2934

Please sign in to comment.