Skip to content

Questions for computing of derivatives #1

Open
@khanrc

Description

@khanrc

I cannot understand your code for computing derivatives:

#first_derivative
first_derivative = tf.exp(cost)[0][label_index]*target_conv_layer_grad 	
	
#second_derivative
second_derivative = tf.exp(cost)[0][label_index]*target_conv_layer_grad*target_conv_layer_grad 

#triple_derivative
triple_derivative = tf.exp(cost)[0][label_index]*target_conv_layer_grad*target_conv_layer_grad*target_conv_layer_grad 

My questions are,

  1. Why did you multiply exp(cost) ?
  2. How the second/triple derivatives are calculated through the code? I think it should be like this:
    second derivative: tf.gradient(tf.gradient(Y, A), A)
    triple derivative: tf.gradient(tf.gradient(tf.gradient(Y, A), A), A)

Can you help me?

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