All problems
Product of Sigmoids Gradient
Problem
For f(w) = product_i sigmoid(w_i), the partial derivative with respect to w_i is f(w) * (1 - sigmoid(w_i)) because d(sigmoid)/dw = sigmoid * (1 - sigmoid).
Given the weight vector, return the gradient list.
Hint
The log-derivative trick turns the product into a sum of terms.
Test cases
case 1
in: [[0,0]]
expected: [0.125,0.125]
case 2
in: [[1,2]]
expected: [0.1731752162946797,0.07675646131035557]
case 3
in: [[0,1,2]]
expected: [0.16097856497199306,0.08658760814733985,0.038378230655177786]
Starter codePython
def product_of_sigmoids_gradient(w):
# Your code here
pass3 test cases · run your code against them in the editor