Skip to content

Conversation

@sayantan-nervana
Copy link
Contributor

No description provided.

Copy link
Contributor

@sindhu-nervana sindhu-nervana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sindhu-nervana
Copy link
Contributor

TF python tests seem to be failing with tolerance errors


AssertionError:
--
  | Not equal to tolerance rtol=1e-05, atol=1e-05
  | Mismatched value: a is different from b.
  | not close where = (array([], dtype=int64), array([], dtype=int64))
  | not close lhs = []
  | not close rhs = []
  | not close dif = []
  | not close tol = []
  | dtype = float64, shape = (2, 4)
  | x and y -inf location mismatch:
  | x: array([[-1.386294e+000, -1.386294e+000, -1.386294e+000, -1.386294e+000],
  | [ 0.000000e+000, -1.797693e+308, -1.797693e+308, -1.797693e+308]])
  | y: array([[-1.386294, -1.386294, -1.386294, -1.386294],
  | [     -inf,      -inf,      -inf,      -inf]])

@sayantan-nervana
Copy link
Contributor Author

sayantan-nervana commented May 14, 2019

Investigated one of the test failures softmax_op_test.SoftmaxTest.testAlongFirstDimension:

For this input:
max = np.finfo(type).max # pylint: disable=redefined-builtin
features = np.array([[1., 1., 1., 1.], [max, 1., 2., 3.]]).astype(type)

Tf produces: np.array([[-1.386294, -1.386294, -1.386294, -1.386294],
[0, -max, -max, -max]])
We produce: y: array([[-1.386294, -1.386294, -1.386294, -1.386294],
[ -inf, -inf, -inf, -inf]])
Numpy produces:
array([[-1.38629436, -1.38629436, -1.38629436, -1.38629436],
[ -inf, -inf, -inf, -inf]])
if we do p - log(sum(exp(p)))

But the actual answer should indeed be [0, -max, -max, -max].

Copy link
Contributor

@shresthamalik shresthamalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@avijit-nervana avijit-nervana merged commit ae7191c into master May 20, 2019
@avijit-nervana avijit-nervana deleted the sarkars/logsoftmax branch May 20, 2019 22:05
gopoka pushed a commit that referenced this pull request Oct 28, 2019
gopoka pushed a commit that referenced this pull request Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants