Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Add more math operations. Highlight error lines in webgl shaders #123

Merged
merged 6 commits into from
Sep 13, 2017

Conversation

nsthorat
Copy link
Contributor

@nsthorat nsthorat commented Sep 12, 2017

Adds:

  • math.abs
  • trig: math.sin, math.cos, math.asin, math.acos, math.atan, math.sinh, math.cosh
  • colors the line where a webgl shader compile error happens

image


This change is Reviewable

@nsthorat nsthorat changed the title Add more math operations. Add ability to inline run custom unary / binary ops. Highlight error lines in webgl shaders Add more math operations. Highlight error lines in webgl shaders Sep 12, 2017
@nsthorat nsthorat mentioned this pull request Sep 12, 2017
@dsmilkov
Copy link
Contributor

:lgtm_strong:


Review status: 0 of 17 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


src/math/webgl/unaryop_gpu.ts, line 107 at r2 (raw file):

export const SINH = `
  float e2x = exp(x);

for ops that are not available in glsl, (sinh, cosh) add overflow/underflow tests in trig_gpu_test (see tanh overflow/underflow test for an example)


Comments from Reviewable

@nsthorat
Copy link
Contributor Author

Review status: 0 of 17 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


src/math/webgl/unaryop_gpu.ts, line 107 at r2 (raw file):

Previously, dsmilkov (Daniel Smilkov) wrote…

for ops that are not available in glsl, (sinh, cosh) add overflow/underflow tests in trig_gpu_test (see tanh overflow/underflow test for an example)

sinh and cosh don't asymptote, they explode for large negative and positive values, so I added a test at 0.


Comments from Reviewable

@nsthorat nsthorat merged commit 31f0b07 into master Sep 13, 2017
@nsthorat nsthorat deleted the unary branch September 14, 2017 01:36
mnottheone pushed a commit to mnottheone/deeplearnjs that referenced this pull request Dec 1, 2018
…sorflow#123)

* add more math functionality

* add test for binary op

* add tsdoc

* remove check nan snippet

* remove unary and binary custom sugar methods.

* add cosh(0) and sinh(0) tests. check for nans in sin/cos, they fail on mac
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants