Coder Social home page Coder Social logo

juliadecisionfocusedlearning / inferopt.jl Goto Github PK

View Code? Open in Web Editor NEW
113.0 113.0 4.0 1.24 MB

Combinatorial optimization layers for machine learning pipelines

Home Page: https://juliadecisionfocusedlearning.github.io/InferOpt.jl/

License: MIT License

Julia 100.00%
automatic-differentiation combinatorial-optimization julia machine-learning structured-learning

inferopt.jl's People

Contributors

axelparmentier avatar batyleo avatar dependabot[bot] avatar gdalle avatar louisbouvier avatar pitmonticone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

inferopt.jl's Issues

Keyword arguments for `SPOPlusLoss`

We should be able to provide keywords arguments as input of the SPOPlusLoss, in a similar way as for the FenchelYoungLoss. Also needs to be implemented for SSVMLoss.

Docs revamp

High priority:

Low priority:

  • Way to test without gradient descent, or to avoid testing the full tensor problem * layers
  • Flux or Lux?

Compatibility with ForwardDiff

At the moment, InferOpt uses ChainRulesCore for rrules, but it would be nice to be compatible with ForwardDiff dual numbers

differentiable graph creation

Hello I have a task to create a graph from the output of the convolutional neural network that then will be used in graph neural network.
I have a cost function that can tell wheather graph was well created.
My main problem is that graph by its nature is discrete hence constructing graph creation algorithm in a way that will enable back propagation is problematic (as you see in my architecture gradients need to pass from graph neural networks to CNN)

Can it be potentially possible to use your package for differentiable graph creation from 3D array?

Compatibility with Enzyme

As of today, Enzyme.jl allows custom rules, written in a different format than ChainRules.jl. It would be nice to test InferOpt.jl with this new autodiff backend

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Remove dispatch on `Real`

Currently, most of our code deals with values $y$ or $\theta$ that are typed as AbstractArray{<:Real}. This restriction is not used for dispatch, so it is not essential, and may even prevent the use of other interesting number formats that do not subtype Real. I suggest we remove it

Compatibility with Julia 1.6

It would be nice to be compatible with Julia's Long Term Support (LTS) version 1.6.
I think the main obstacle at the moment is the use of the destructuring syntax (; a, b) = x, which was introduced in Julia 1.7. Shouldn't be hard to fix, and the test CI needs to be updated too.

Better documentation

We urgently need a better documentation with

  • a better intro to the theory
  • examples for all types of loss functions
  • examples for using kwargs to pass instances (#56)
  • a guide for choosing your layer à la scikit-learn

Extend `DifferentiableFrankWolfe` beyond vectors

At the moment, DifferentiableFrankWolfe (see the giom branch) only works when θ is a vector, not a higher-dimensional array.
It should be easy to implement flattening / unflattening to generalize it.

Allow more general objectives in combinatorial layers

Currently, InferOpt fully supports predictors of the form $\arg\max_y \theta^\top y$ in combinatorial layers.
It would be interesting to allow the more general form $$\arg\max_y \theta^\top g(y) + h(y)$$
For the moment, a workaround is to make your predictor return $g(y)$ instead of $y$. This way, gradient computation are correct, but loss value computations are not when $h\neq0$ (there is a missing term), therefore the training will work but the loss metric value will be slightly incorrect.

One implementation option would be to enforce returning the objective value as an additional output of the predictor.

Explain chain rules

I must make it easier for contributors to understand how chain rules are written. This requires:

  • basics of autodiff and VJPs
  • formulas

Get rid of ThreadsX?

We can speed up loading of InferOpt by replacing ThreadsX with built-in threads:

res = ThreadsX.map(f(i) for i in 1:n)

would become

f1 = f(1)
res = Vector{typeof(f1)}(undef, n)
res[1] = f1
@threads for i in 2:n
    res[i] = f(i)
end

Downsides:

  • less readable code
  • performance hit due to the first element: complexity 1 + (n-1)/t instead of n/t for t threads

Upsides:

  • less dependencies, faster loading of InferOpt
  • improved type stability?

Get rid of SimpleTraits?

I think traits are a hassle for users who want a quick and easy implem. If the required methods do not exist for their structures, Julia will throw an error anyway. I suggest we get rid of SimpleTraits and just use unconstrained type parameters for regularization and imitation losses.

Is there a downside to this?

Fix JET tests

Since I figured out how to use JET.report_package properly, it throws a few errors for interface functions that are not implemented. For now the test is skipped, but we need to reactivate it.

Cite alternatives

It would be nice to put alternatives in the docs:

Julia:

  • DiffOpt.jl
  • ImplicitDifferentiation.jl
  • StochasticAD.jl

Python:

  • JAXopt
  • PyEPO
  • storchastic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.