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

Use nansafe branch for ForwardDiff #165

Closed
wants to merge 6 commits into from

Conversation

sharanry
Copy link
Contributor

Related issue and comment: #116 (comment)
Fix proposed here: JuliaDiff/ForwardDiff.jl#451

This uses the nansafe branch of ForwardDiff in order to fix issues with FBM kernel.

@@ -18,7 +18,7 @@ AxisArrays = "0.4.3"
Distances = "0.9"
FiniteDifferences = "0.10.8"
Flux = "0.10, 0.11"
ForwardDiff = "0.10"
ForwardDiff = "nansafe"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't seem to help as suggested here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other suggested solution is including this information in the test/Manifest.toml. But I am not sure if we want to do that.
https://discourse.julialang.org/t/specifying-a-branch-of-a-package-in-project-toml/32101/3

Copy link
Member

Choose a reason for hiding this comment

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

I would be surprised if there would be a way to specify in the Project.toml, and in your links it is explicitly stated that it does not work currently.

An alternative would be to add something like

import Pkg; Pkg.add(url="https://github.com/JuliaDiff/ForwardDiff.jl", rev="nansafe")

to test/runtests.jl (or the Travis script, but I guess it would be better to add it to runtests.jl since otherwise tests would fail locally).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like Pkg is not available in the Travis test environment for runtests.jl to use. https://travis-ci.com/github/JuliaGaussianProcesses/KernelFunctions.jl/jobs/383271248#L421

We might be forced to add this in the Travis script.

Copy link
Member

Choose a reason for hiding this comment

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

You just have to add it to the test dependencies, then the lines above will work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@devmotion Do you mean we need to add Pkg to test dependencies?

Copy link
Member

Choose a reason for hiding this comment

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

Yes.

I'm not sure yet though if it's really a good idea to use the nansafe branch for testing.

test/runtests.jl Outdated Show resolved Hide resolved
@devmotion
Copy link
Member

It seems tests on Travis still yield NaN values even with this branch - it doesn't fix (all of) the AD problems?

@sharanry
Copy link
Contributor Author

It seems tests on Travis still yield NaN values even with this branch - it doesn't fix (all of) the AD problems?

Locally it seems to fix problems only for FBM, Gabor and Wiener Kernels.

@theogf
Copy link
Member

theogf commented Oct 14, 2021

@devmotion @sharanry Can we close this PR? I does not look possible to use a specific branch for testing and does not generally look like a good idea :D

@devmotion
Copy link
Member

Yes, JuliaDiff/ForwardDiff.jl#539 (or something similar) and switching to NaN-safe mode if desired seems to be the way to go.

@devmotion devmotion closed this Oct 14, 2021
@devmotion devmotion deleted the sharan/fix-FBM-forwardDiff branch October 14, 2021 17:32
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.

3 participants