Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #172 from invenia/aa/fdm
Browse files Browse the repository at this point in the history
Updates for FDM v0.6.0
  • Loading branch information
ararslan committed May 30, 2019
2 parents 8d5fa97 + 2ff6788 commit 05d2f28
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
@@ -1,6 +1,6 @@
name = "Nabla"
uuid = "49c96f43-aa6d-5a04-a506-44c7070ebe78"
version = "0.12.0"
version = "0.12.1"

[deps]
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
Expand All @@ -13,7 +13,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
DiffRules = "^0.0"
DualNumbers = ">=0.6.0"
FDM = ">=0.1.0"
FDM = "^0.6"
SpecialFunctions = ">=0.5.0"
julia = "^1.0"

Expand Down
3 changes: 1 addition & 2 deletions src/finite_differencing.jl
Expand Up @@ -21,9 +21,8 @@ function approximate_Dv(
x::Tuple{Vararg{∇ArrayOrScalar}},
v::Tuple{Vararg{∇ArrayOrScalar}}
)
return central_5_1-> sum(ȳ .* f((x .+ ε .* v)...)))
return FDM.Central(5, 1)-> sum(ȳ .* f((x .+ ε .* v)...)))
end
central_5_1 = central_fdm(5, 1; M=5e8)
approximate_Dv(f, ȳ::∇ArrayOrScalar, x::∇ArrayOrScalar, v::∇ArrayOrScalar) =
approximate_Dv(f, ȳ, (x,), (v,))

Expand Down
1 change: 1 addition & 0 deletions test/sensitivities/linalg/blas.jl
Expand Up @@ -27,6 +27,7 @@ using LinearAlgebra.BLAS
λ = x->asum(50, x, 2)
for _ in 1:10
x, vx = randn(rng, 100), randn(rng, 100)
x .+= sign.(x)
@test check_errs(asum, randn(rng), x, vx)
@test check_errs(λ, randn(rng), x, vx)
end
Expand Down
4 changes: 2 additions & 2 deletions test/sensitivities/linalg/factorization/cholesky.jl
Expand Up @@ -46,9 +46,9 @@
let rng = MersenneTwister(123456), N = 10
for _ in 1:10
B, VB = randn.(Ref(rng), [N, N], [N, N])
A, VA = B'B + 1e-6I, VB'VB + 1e-6I
A, VA = B'B + I, VB'VB + I
= UpperTriangular(randn(rng, N, N))
@test check_errs(X->cholesky(X).U, Ū, A, 1e-2 .* VA)
@test check_errs(X->cholesky(X).U, Ū, A, VA)
end
end

Expand Down

2 comments on commit 05d2f28

@ararslan
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/1086

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.1 -m "<description of version>" 05d2f281f426674ada46c14724485f2a7c43aa1b
git push origin v0.12.1

Please sign in to comment.