Skip to content
DeepForgeby svx
All problems
EasyCalculusca-336

Sigmoid Second Derivative Vector

Problem

The sigmoid has second derivative sigmoid(z) * (1 - sigmoid(z)) * (1 - 2 * sigmoid(z)).

Given the values z, return the second derivative list.

Hint

Differentiate s(1 - s) once more with the chain rule.

Test cases

case 1
in: [[0,1,-1]]
expected: [0,-0.09085774767294842,0.09085774767294842]
case 2
in: [[2,-2]]
expected: [-0.07996250105615312,0.07996250105615305]
case 3
in: [[0.5,3]]
expected: [-0.05755679485232076,-0.04089157466094337]
Starter codePython
def sigmoid_second_derivative(values):
    # Your code here
    pass

3 test cases · run your code against them in the editor