Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First feedback. Examples for AD community? #61

Closed
KlausLeppkes opened this issue Sep 30, 2020 · 1 comment
Closed

First feedback. Examples for AD community? #61

KlausLeppkes opened this issue Sep 30, 2020 · 1 comment
Assignees

Comments

@KlausLeppkes
Copy link
Collaborator

Hi,

I cloned, build and played around with enzyme and I am very happy so far!:)
I want to point out that enzyme is not only calculating gradients, but also implements the adjoint semantics (this is great news for me!).

So do you have plans to add examples for the (AD) community?

I don't want to create a pull request yet, so here is my first quick and dirty test (modified the sumAndMul function to become a speelpenning(ish) function with 2 outputs).

put the attached files into $(ENZYME_ROOT)/ad/test, calling
$make

results in correct input adjoints for calling dF 3 times with (1,0), (0,1) and (1,1) for the outptut adjoints (d_mul and d_out2).

./output.exe
d(output)/darray[0] = 24.000000
d(output)/darray[1] = 12.000000
d(output)/darray[2] = 8.000000
d(output)/darray[3] = 6.000000

d(output)/darray[0] = 48.000000
d(output)/darray[1] = 24.000000
d(output)/darray[2] = 16.000000
d(output)/darray[3] = 12.000000

d(output)/darray[0] = 72.000000
d(output)/darray[1] = 36.000000
d(output)/darray[2] = 24.000000
d(output)/darray[3] = 18.000000

Very nice!
first_example.zip

@wsmoses
Copy link
Member

wsmoses commented Sep 30, 2020

Indeed we do! This is both because we want to provide this functionality and it actually makes the design much simpler.

And we definitely want to include these examples. If you have any suggestions you should feel free to make a pull request either for the main branch or the website (www branch)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants