Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

don't descend into our library of math functions #32

Merged
merged 1 commit into from
Apr 30, 2020
Merged

Conversation

shashi
Copy link
Collaborator

@shashi shashi commented Apr 30, 2020

fixes #30

@shashi
Copy link
Collaborator Author

shashi commented Apr 30, 2020

thats a lot of really slow CIs.

@ChrisRackauckas ChrisRackauckas merged commit ee11c11 into master Apr 30, 2020
@shashi shashi deleted the s/fix-30 branch April 30, 2020 23:42
@shashi
Copy link
Collaborator Author

shashi commented Apr 30, 2020

I think isleaf should be part of the API.

isleaf(f) = true means that if f is called with x<tag>, then return f(x)<tag> instead of trying f(x<tag>).

So if someone has a function like:

function g(a)
   while a < 1
       a+= rand()
    end
    a
end

for whatever reason

and they then want to sparsity detect

f(y, x) = y .= g.(x)

Then they can set SparsityDetection.isleaf(::typeof(g)) = true and it will work.

@ChrisRackauckas
Copy link
Member

Wouldn't they need to also give you what the sparsity of that function is in the API?

@shashi
Copy link
Collaborator Author

shashi commented May 1, 2020

Yes, but it can be optional in case of Jacobian. (because you can just say the output depends on all the inputs).. But you're right they would have to say something about it for Hessian.

Well there is a way to say that too SparsityDetection.linearity

@ChrisRackauckas
Copy link
Member

oh it's only for scalar functions?

@shashi
Copy link
Collaborator Author

shashi commented May 1, 2020

Yeah well that's the easiest thing to provide an API for right away. We currently don't have decent ways of converting sparsity matrix into our metadata (ProvinanceSet or TermCombination although that should be not so hard to do).

Let's hold this thought and if there is a real need for treating sub functions as blackboxes of known sparsity, then we can come back to this idea.

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.

Jacobian sparsity detection takes a very long time and fails some times
2 participants