Hi,
Although I have used Tanh in my make_generator code. I am getting this assertion fail error.
AssertionError Traceback (most recent call last)
Input In [8], in <cell line: 11>()
7 assert hidden_output.std() > 0.5
9 assert tuple(test_hidden_block_stride(hidden_output).shape) == (num_test, 20, 10, 10)
β> 11 assert final_output.max().item() == 1
12 assert final_output.min().item() == -1
14 assert tuple(gen_output.shape) == (num_test, 1, 28, 28)
AssertionError:
I am getting 0.9998 and -0.9999 for max and min for final_output
Can someone help me please ?
Regards
Gagan
If I am understanding this right it seems pretty close to the result so maybe a rounding issue here.
I suggest you go in the previous cells and check if you have made some mistake somewhere.
Also if you could check the tests in utils file could be helpful ro you.
Wendy
March 31, 2023, 6:03pm
3
One thing to check is to make sure num_test is still set to 100:
num_test = 100
If you accidentally changed that to a very small number, like 1 or 2, your odds of not getting exactly 1 or -1 will increase. With 100, your odds should be extremely slim.
Youβre using this nn.Tanh() , right?
1 Like
Thanks to wendy and gent. I realized that I was using batch normalization in my final layer which caused this problem. It is fixed now.