Skip to content

tf.gradients producing unexpected results  #303

Closed

Description

@moloneymb

It appears that the tf.gradients function has a bug in it.

For the example x^3 * 0.1 should be 3x^2 * 0.1 but it appears to be x^2 * 0.1.

In TF.Net

let x = tf.constant(7.0)
let y = x*x*x*tf.constant(0.1)
sess.run(tf.gradients(y,x)).[0].Data<double>()
//[|4.9|]

In Python

x = tf.constant(7.0)
y = x*x*x*tf.constant(0.1)
sess.run(tf.gradients(y,x))
#[14.7]

Activity

  1. self-assigned this
    on Jul 23, 2019
  2. added
    bug
    on Jul 23, 2019
  3. Oceania2018 commented on Jul 24, 2019

    @Oceania2018
    Member

    image

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions