Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

[linalg] Add support for cholesky decomposition #563

Merged
merged 1 commit into from
Nov 21, 2019

Conversation

jon-tow
Copy link
Contributor

@jon-tow jon-tow commented Nov 21, 2019

Adds basic support for cholesky decomposition.

Issue: #562

Copy link
Contributor

@saeta saeta left a comment

Choose a reason for hiding this comment

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

This is awesome! Thank you @jon-tow

Copy link
Member

@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.

Great doc comments and testing!

@dan-zheng dan-zheng merged commit c09de96 into tensorflow:master Nov 21, 2019
@awav
Copy link
Contributor

awav commented Nov 21, 2019

Awesome! @dan-zheng , @saeta

@jon-tow jon-tow deleted the linalg/choleksy branch November 21, 2019 19:11
[0.02154995, 0.2738613]],
[[2.4748755, -0.7071073],
[-0.7071073, 0.3535535]]])
assertEqual(computedGradient, expectedGradient, accuracy: 1e-5)
Copy link
Contributor

Choose a reason for hiding this comment

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

The accuracy level: is that a rtol or atol?

Copy link
Contributor

Choose a reason for hiding this comment

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

in any case it is too high

/// - Parameter input: A tensor of shape `[..., M, M]`.
@inlinable
@differentiable(vjp: _vjpCholesky)
public func cholesky<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work with batching?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, it sure does! Check out some of the shapes used in testing.

let shapes = [[3, 3], [4, 2, 2], [2, 1, 16, 16]]

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.

5 participants