MLS Course 2 Week 1 Assignment - Exercise 2 failed Unit Tests

Hi everyone, the Exercise Unit test is failing, the error thrown is around an incorrect dot product, whereas the output vector is matching.

{moderator edit: code removed}

Inside the my_dense() function, your code should use the function parameter ‘g(…)’ for the activation function.

Not ‘sigmoid(…)’.

The unit test does not use the sigmoid() activation, so you should not hard-code it.

Please do not post your code on the forum. The Community Standards do not allow it.

Thanks for the resolution - this is working now. The unit test specifically works when g is declared outside the my_dense function and not when it’s declared inside. Why would that be case ?

Will ensure that I do not post any code going forward.