Skip to content

[AutoDiff] Add #chainableGradient differential operator for seedable gradient #18250

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

Merged
merged 2 commits into from
Jul 26, 2018

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Jul 26, 2018

#chainableGradient takes a function and returns a function, which takes original parameters and a backpropagated adjoint, and computes vector-Jacobian products.

func f(_ x: Float) -> Float { ... }
let y = f(x)
let dz_dy = ...
let dz_dx = #chainableGradient(f)(x, dz_dy)

#chainableGradient corresponds to the gradient [seedable] instruction in SIL.

Sema and libSyntax are to be done separately. This is a random patch to unblock the progress towards a way to express seedable derivatives in Swift source code.

@rxwei rxwei requested a review from dan-zheng July 26, 2018 06:14
@rxwei
Copy link
Contributor Author

rxwei commented Jul 26, 2018

@swift-ci please test tensorflow

Copy link
Contributor

@dan-zheng dan-zheng left a comment

Choose a reason for hiding this comment

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

Sweet!

@dan-zheng
Copy link
Contributor

I'm happy to tackle Sema and Syntax for #chainableGradient if you'd like to work on other parts of autodiff. Let me know!

@rxwei
Copy link
Contributor Author

rxwei commented Jul 26, 2018

@dan-zheng Thx. Don't worry about it today. Let's try to get more deabstraction bugs fixed.

@rxwei
Copy link
Contributor Author

rxwei commented Jul 26, 2018

@swift-ci please test tensorflow

1 similar comment
@rxwei
Copy link
Contributor Author

rxwei commented Jul 26, 2018

@swift-ci please test tensorflow

@rxwei rxwei merged commit 0c66055 into swiftlang:tensorflow Jul 26, 2018
@rxwei rxwei deleted the diffop branch July 27, 2018 00:34
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

Successfully merging this pull request may close these issues.

2 participants