Skip to content

The sigmoidGradient function isn't defined #6

Description

@Zijun-Peng

I was writing the nnCostFunction function, but the sigmoidGradient function isn't defined?

NameError Traceback (most recent call last)
in
1 lambda_ = 0
2 J, _ = nnCostFunction(nn_params, input_layer_size, hidden_layer_size,
----> 3 num_labels, X, y, lambda_)
4 print('Cost at parameters (loaded from ex4weights): %.6f ' % J)
5 print('The cost should be about : 0.287629.')

in nnCostFunction(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y, lambda_)
42
43 delta_3 = a3 - y_matrix
---> 44 delta_2 = delta_3.dot(Theta2)[:, 1:] * sigmoidGradient(a1.dot(Theta1.T))
45
46 Delta1 = delta_2.T.dot(a1)

NameError: name 'sigmoidGradient' is not defined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions