A toolkit for Lagrangian-based constrained optimization in Pytorch

Overview

Cooper

LICENSE DOCS Build and Test Codecov

About

Cooper is a toolkit for Lagrangian-based constrained optimization in Pytorch. This library aims to encourage and facilitate the study of constrained optimization problems in machine learning.

Cooper is (almost!) seamlessly integrated with Pytorch and preserves the usual loss -> backward -> step workflow. If you are already familiar with Pytorch, using Cooper will be a breeze! 🙂

Cooper was born out of the need to handle constrained optimization problems for which the loss or constraints are not necessarily "nicely behaved" or "theoretically tractable", e.g. when no (efficient) projection or proximal are available. Although assumptions of this kind have enabled the development of great Pytorch-based libraries such as CHOP and GeoTorch, they are seldom satisfied in the context of many modern machine learning problems.

Many of the structural design ideas behind Cooper are heavily inspired by the TensorFlow Constrained Optimization (TFCO) library. We highly recommend TFCO for TensorFlow-based projects and will continue to integrate more of TFCO's features in future releases.

⚠️ This library is under active development. Future API changes might break backward compatibility. ⚠️

Getting Started

Here we consider a simple convex optimization problem to illustrate how to use Cooper. This example is inspired by this StackExchange question:

I am trying to solve the following problem using Pytorch: given a 6-sided die whose average roll is known to be 4.5, what is the maximum entropy distribution for the faces?

import torch
import cooper

class MaximumEntropy(cooper.ConstrainedMinimizationProblem):
    def __init__(self, mean_constraint):
        self.mean_constraint = mean_constraint
        super().__init__(is_constrained=True)

    def closure(self, probs):
        # Verify domain of definition of the functions
        assert torch.all(probs >= 0)

        # Negative signed removed since we want to *maximize* the entropy
        entropy = torch.sum(probs * torch.log(probs))

        # Entries of p >= 0 (equiv. -p <= 0)
        ineq_defect = -probs

        # Equality constraints for proper normalization and mean constraint
        mean = torch.sum(torch.tensor(range(1, len(probs) + 1)) * probs)
        eq_defect = torch.stack([torch.sum(probs) - 1, mean - self.mean_constraint])

        return cooper.CMPState(loss=entropy, eq_defect=eq_defect, ineq_defect=ineq_defect)

# Define the problem and formulation
cmp = MaximumEntropy(mean_constraint=4.5)
formulation = cooper.LagrangianFormulation(cmp)

# Define the primal parameters and optimizer
probs = torch.nn.Parameter(torch.rand(6)) # Use a 6-sided die
primal_optimizer = cooper.optim.ExtraSGD([probs], lr=3e-2, momentum=0.7)

# Define the dual optimizer. Note that this optimizer has NOT been fully instantiated
# yet. Cooper takes care of this, once it has initialized the formulation state.
dual_optimizer = cooper.optim.partial_optimizer(cooper.optim.ExtraSGD, lr=9e-3, momentum=0.7)

# Wrap the formulation and both optimizers inside a ConstrainedOptimizer
coop = cooper.ConstrainedOptimizer(formulation, primal_optimizer, dual_optimizer)

# Here is the actual training loop.
# The steps follow closely the `loss -> backward -> step` Pytorch workflow.
for iter_num in range(5000):
    coop.zero_grad()
    lagrangian = formulation.composite_objective(cmp.closure, probs)
    formulation.custom_backward(lagrangian)
    coop.step(cmp.closure, probs)

Installation

Basic Installation

pip install git+https://github.com/cooper-org/cooper.git

Development Installation

First, clone the repository, navigate to the Cooper root directory and install the package in development mode by running:

Setting Command Notes
Development pip install --editable ".[dev, tests]" Editable mode. Matches test environment.
Docs pip install --editable ".[docs]" Used to re-generate the documentation.
Tutorials pip install --editable ".[examples]" Install dependencies for running examples
No Tests pip install --editable . Editable mode, without tests.

Package structure

  • cooper - base package
    • problem - abstract class for representing ConstrainedMinimizationProblems (CMPs)
    • constrained_optimizer - torch.optim.Optimizer-like class for handling CMPs
    • lagrangian_formulation - Lagrangian formulation of a CMP
    • multipliers - utility class for Lagrange multipliers
    • optim - aliases for Pytorch optimizers and extra-gradient versions of SGD and Adam
  • tests - unit tests for cooper components
  • tutorials - source code for examples contained in the tutorial gallery

Contributions

Please read our CONTRIBUTING guide prior to submitting a pull request. We use black for formatting, isort for import sorting, flake8 for linting, and mypy for type checking.

We test all pull requests. We rely on this for reviews, so please make sure any new code is tested. Tests for cooper go in the tests folder in the root of the repository.

License

Cooper is distributed under an MIT license, as found in the LICENSE file.

Acknowledgements

Cooper supports the use of extra-gradient style optimizers for solving the min-max Lagrangian problem. We include the implementations of the extra-gradient version of SGD and Adam by Hugo Berard.

We thank Manuel del Verme for insightful discussions during the early stages of this library.

This README follows closely the style of the NeuralCompression repository.

How to cite this work?

If you find Cooper useful in your research, please consider citing it using the snippet below:

@misc{gallegoPosada2022cooper,
    author={Gallego-Posada, Jose and Ramirez, Juan},
    title={Cooper: a toolkit for Lagrangian-based constrained optimization},
    howpublished={\url{https://github.com/cooper-org/cooper}},
    year={2022}
}
Comments
  • how to use cuda acceleration

    how to use cuda acceleration

    Hi, I was wondering if cooper can use cuda to accelerate the computation. (I thought it could, but there is no place to claim something like probs.cuda() )

    bug 
    opened by Timbrer 3
  • Remove aliases to Pytorch implementations

    Remove aliases to Pytorch implementations

    Enhancement

    Remove existing aliases to objects in torch.optim. Update documentation accordingly.

    Motivation

    Having these aliases makes the interface opaque for the user: it is hard to tell that cooper.optim.SGD is in fact the same implementation as torch.optim.SGD.

    documentation enhancement good first issue 
    opened by gallego-posada 3
  • Non comprehensive `__init__` files

    Non comprehensive `__init__` files

    Enhancement

    __init__ files throughout Cooper are not fully consistent.

    For instance, Cooper.__init__ imports UnconstrainedFormulation and LagrangianFormulation , but not AugmentedLagrangianFormulation. https://github.com/cooper-org/cooper/blob/a8b3400fecbe9e6e8e5e8c4d49c7959623a0154e/cooper/init.py#L18-L22

    For consistency, we should import the AugmentedLagrangianFormulation as well.

    Note: Creating an issue as there may be other instances of this throughout the library.

    enhancement 
    opened by juan43ramirez 1
  • Deprecated `StateLogger`

    Deprecated `StateLogger`

    Bug

    The StateLogger in cooper.utils.state_logger.py is not compatible with the latest version of Cooper's dev branch.

    It assumes that a Formulation will have a ConstrainedMinimizationProblem as an attribute:

    https://github.com/cooper-org/cooper/blob/3e0aa6fd80b2977936db8aae4affce78bb466379/cooper/utils/state_logger.py#L42-L48

    This is not the case since merging #56.

    Steps

    Update the interface of StateLogger. store_metrics should receive a CMPState or the unpacked metrics.

    bug 
    opened by juan43ramirez 1
  • Provide more

    Provide more "real-life" example in README

    Enhancement

    Modify README to include a more comprehensive example of how to use Cooper for machine learning problems. Some features to cover include:

    • Integration with torch.nn.Module
    • Using CUDA acceleration
    • Data loaders and mini-batching

    We could to have two versions:

    • One with "off-the-shelf Cooper": no explicit user-defined closure
    • One with explicit closure definition, which enables the use of advanced features like extrapolation optimizers

    Maybe only include the first one in the README, and keep the second version for the docs.

    enhancement 
    opened by gallego-posada 1
  • Cooper level wrappers for `formulation.custom_backward` and `formulation.composite_objective`

    Cooper level wrappers for `formulation.custom_backward` and `formulation.composite_objective`

    Enhancement

    Create wrappers cooper.backward for formulation.custom_backward and cooper.compute_lagrangian for formulation.composite_objective.

    This would change the way a user interacts with Cooper. However, it does not represent a change in Cooper's back-end.

    Motivation

    A cleaner pipeline for the user, where there is no need to access the methods of a formulation:

    for step in range(num_steps):
        ...
        constrained_optimizer.zero_grad()
        lagrangian = cooper.compute_lagrangian(formulation, ...)
        cooper.backward(formulation, lagrangian)
        constrained_optimizer.step()
    

    As opposed to the current pipeline:

    for step in range(num_steps):
        ...
        constrained_optimizer.zero_grad()
        lagrangian = formulation.composite_objective(...)
        formulation.custom_backward(lagrangian)
        constrained_optimizer.step()
    
    enhancement 
    opened by juan43ramirez 1
  • Easy as possible to use

    Easy as possible to use

    Enhancement

    Make Cooper as easy as possible to integrate with a vanilla Pytorch pipeline.

    In particular, allow for the user to populate a CMPState and provide it to Cooper without having to create a custom ConstrainedMinimizationProblem.

    Note that we should not remove the CMP altogether. In particular, extrapolation and alternating updates would still require internal calls to cmp.closure and cmp.defect_fn.

    This would require a major overhaul of the documentation, tutorials, and examples, showcasing that both the previous CMP approach and this new approach are admissible. Love for the documentation has also been requested in #53 and #29.

    Motivation

    Users are currently required to implement a custom ConstrainedMinimizationProblem with a closure method. This overhead can be detrimental to Cooper attracting ML researchers and practitioners who would otherwise compute the loss and constraint violations themselves.

    For minimal integrations with Cooper which do not need "fancy features" like Augmented Lagrangian or Extrapolation, simply asking for the loss and constraint defects makes the user's life easier.

    Alternatives

    It may be possible to remove the CMP completely. Nonetheless, we would still require a closure for an internal call during extrapolation steps and a defect_fc for internal use by the AlternatingConstrainedOptimizer.

    enhancement 
    opened by juan43ramirez 1
  • Modularize ConstrainedOptimizer

    Modularize ConstrainedOptimizer

    Enhancement

    Modularize the constrained_optimizer.py script to have a BaseConstrainedOptimizerclass from which specific optimization approaches can stem.

    For instance, a SimultaneousOptimizer, AlternatingOptimizer, ExtrapolationOptimizer, and in the future perhaps an ExtrapolationFromThePastOptimizer.

    Motivation

    Current implementation of ConstrainedOptimizer is very flexible: it allows for unconstrained optimization, constrained optimization with simultaneous and alternating updates and extragradient updates.

    Because of this, the logic inside the ConstrainedOptimizer class has become overly complex. https://github.com/cooper-org/cooper/blob/f1d95543f48d1127da8111d285f45fc5936426c6/cooper/constrained_optimizer.py#L268-L270

    A more modularized implementation would make the code easier to understand and less error prone. The added flexibility would enable implementing new optimization approaches, like extrapolation from the past [1].

    A similar approach was taken with the Formulations, where a BaseLagrangianFormulation underpins the LagrangianFormulation and ProxyLagrangianFormulation.

    References

    • Gidel, G., Berard, H., Vignoud, G., Vincent, P., & Lacoste-Julien, S. (2019). A variational inequality perspective on generative adversarial networks. In ICLR.
    enhancement 
    opened by juan43ramirez 1
  • dual_scheduler steps may happen multiple times per epoch

    dual_scheduler steps may happen multiple times per epoch

    Bug

    The call to dual_scheduler.step() happens at the end of ConstrainedOptimizer.step(). This means that dual_scheduler steps happen at the end of every optimization step and not every optimization epoch.

    https://github.com/cooper-org/cooper/blob/eae7c5a68563b83410913c8b24e99b70e32694f3/cooper/constrained_optimizer.py#L235-L240

    This goes against the Pytorch convention on learning rate schedulers.

    Expected behavior

    Calls to dual_scheduler.step() should happen at the end of every epoch.

    How to fix

    We could: (i) Remove the call to dual_scheduler.step() from inside the ConstrainedOptimizer and let the user handle it. The instantiation of the dual scheduler could still be performed internally so that the partial_lr_scheduler logic is preserved (and for the user to not worry about it). (ii) Indicate whether a step is the last of its epoch and only then call dual_scheduler.step(). (iii) Create a class which wraps both the primal and dual schedulers (like how the ConstrainedOptimizer wraps primal and dual optimizers), whose step() method is manually called by the user at the end of an epoch. The class could internally handle the initialization of the dual scheduler. This approach is similar to (i)

    bug 
    opened by juan43ramirez 1
  • Multiple Primal Optimizers

    Multiple Primal Optimizers

    Closes #39

    Changes

    Parameter primal_optimizer of ConstrainedOptimizer renamed to primal_optimizers. It accepts either a (i) torch.optim.Optimizer or a (ii) list of Optimizers. Behavior in case (i) is unchanged.

    Lines previously performing constrained_optimizer.primal_optimizer.method() have been replaced by for primal_optimizer in constrained_optimizer.primal_optimizers; primal_optimizer.method(). For instance,

    https://github.com/cooper-org/cooper/blob/4421115314e25386042cbd2c3731b03aa766f082/cooper/constrained_optimizer.py#L329-L330

    Saving and loading of checkpoints was modified to allow for lists of primal optimizers.

    Warning ⚠ This breaks backward compatibility when instantiating a ConstrainedOptimizer with keyword argument primal_optimizer.

    Testing

    Toy2D testing of constrained and unconstrained execution included in test_optimizer.py. Checkpointing test included in test_checkpoint.py

    This functionality is not tested together with other optimization methods or formulations (Extragradient, Augmented Lagrangian, Proxy constraints).

    Docs

    Note added in constrained_optimizer.rst indicating that functionality exists. Small section added in optim.rst describing how to setup multiple primal optimizers and how Cooper handles them. Docstrings and overall documentation updated to be general enough for multiple optimizers.

    enhancement 
    opened by juan43ramirez 1
  • Loading state_dict of dual_schedulers

    Loading state_dict of dual_schedulers

    Bug

    The instantiation of the dual_scheduler inside ConstrainedOptimizer.load_from_state_dict method has a bug. The variable containing the dual scheduler class is called dual_scheduler_class as opposed to dual_scheduler. https://github.com/cooper-org/cooper/blob/f75dff39608f2d2895411c6e40e3675aba03c0f2/cooper/constrained_optimizer.py#L491

    Steps

    Replace current line to dual_scheduler = dual_scheduler_class(dual_optimizer)

    Expected behavior

    This should enable the loading of a dual_scheduler from a checkpoint.

    bug 
    opened by juan43ramirez 1
  • 54 multiplier models

    54 multiplier models

    Closes #54

    Changes

    On the multipliers module we created a new class called cooper.multipliers.MultiplierModel, which predicts the value of the Lagrange multipliers associated with the equality or inequality constraints of a cooper.problem.ConstrainedMinimizationProblem. Additionally, we created a new Lagrangian formulation --> cooper.formulation.LagrangianFormulation that works with the created MultiplierModel class.

    Testing

    We tested the class multipliers.MultiplierModel with the simplest model. A linear model with a single output. The new Lagrangian Formulation was also tested.

    References

    This idea comes from the paper by Narasimhan et al. and we took their repository as reference.

    enhancement 
    opened by IsitaRex 0
  • Extrapolation from the past

    Extrapolation from the past

    Enhancement

    Implement the extrapolation from the past algorithm (Popov, 1980). A good and modern source is Gidel et al. (2019).

    This is an algorithm for computing parameter updates similar to extragradient: it computes the direction for updating parameters based on a "lookahead step". It is less intensive computationally than extragradient and enjoys similar convergence results for some class problems (Gidel et al., 2019).

    Motivation

    Whereas extragradient requires two gradient computations per parameter update, extrapolation from the past stores and re-uses gradients from previous extrapolation steps for use during current extrapolation steps. This means less computational intensity in terms of gradient calculations, which may be helpful in some settings.

    However, storing the previous gradients still means an overhead in terms of storage as opposed to gradient descent-ascent.

    References

    • G. Gidel, H. Berard, G. Vignoud, P. Vincent, S. Lacoste-Julien. A Variational Inequality Perspective on Generative Adversarial Networks. In ICLR, 2019.
    • L. D. Popov. A modification of the arrow-hurwicz method for search of saddle points. Mathematical notes of the Academy of Sciences of the USSR, 1980.
    enhancement 
    opened by juan43ramirez 0
  • Multiplier Models

    Multiplier Models

    Enhancement

    Implement a "Multiplier Model" in Cooper. This idea comes from the paper by Narasimhan et al.

    Instead of tracking the Lagrange Multipliers of a constrained optimization problem explicitly, consider a model which takes as input features associated with each constraint and outputs their corresponding multiplier.

    This requires a new kind of Multiplier in Cooper different from a DenseMultiplier. In turn, we might want to create and abstract class for multipliers outlining how a custom multiplier needs to be implemented.

    This also requires a new formulation or the modification of an existing one. Note that the dual_parameters do not match the multipliers in this new functionality. Multipliers are the outputs of the Multiplier Model, whereas the dual_parameters would be the actual weights of said model.

    Motivation

    Consider problems with an extremely large (or even infinite) number of constraints. It becomes computationally intractable to evaluate and keep track of each constraint. Moreover, when solving the problem with an (explicit) Lagrangian formulation, there is the requirement to store and update an equally large number of multipliers.

    With a Multiplier Model, Lagrange multipliers can be computed "on demand", given the constraints that were evaluated at each time step. As long as the Multiplier Model has less parameters than the total possible number of multipliers, there is a gain in terms of storage.

    Also, note that the Multiplier Model's parameters are shared across constraints. Therefore, they can learn to have similar multipliers for constraints which tend to be similar to one another.

    References

    enhancement 
    opened by juan43ramirez 0
  • Document modularized optimizers

    Document modularized optimizers

    Enhancement

    This PR #52 made significant changes to the structure of the code for constrained optimizers. However, this change has not been fully integrated into the docs.

    documentation enhancement 
    opened by gallego-posada 0
  • Example for lagrangian constraints

    Example for lagrangian constraints

    The documentation of this library is very limited and it is hard to parse how it should be applied for different applications. For instance, in Many RL algorithms such as PPO and MPO, an entropy regularization terms or the KL constraints between policies employed to stabilise standard RL objectives. Is it possible to give a practical example of how one can use this library for a dual problem with lagrangian multipliers for such applications?

    Many thanks.

    enhancement 
    opened by neuronphysics 0
  • Do `maximize=True` for dual_optimizers

    Do `maximize=True` for dual_optimizers

    Enhancement

    Pytorch optimizers include a maximize flag (Pytorch Issue)*. When set to True, the sign of gradients is flipped inside optimizer.step() before computing parameter updates. This enables gradient ascent steps natively.

    NOTE: This sign flip does not affect the parameter's .grad attribute.

    Cooper currently populates the gradients of dual variables with their negative value, so that descent steps performed by the dual optimizer are in fact ascent steps towards optimizing the problem formulation.

    https://github.com/cooper-org/cooper/blob/09df7597e9e42deed4c7a162a2bb345868c8bf23/cooper/constrained_optimizer.py#L401-L406

    We should not do the sign flipping manually but rather force set maximize=True when instantiating the dual optimizer.

    * This has been implemented on on Pytorch's master branch for every optimizer but LBFGS . On v1.12, Adam, SGD and AdaGrad support the flag, but not RMSProp. An assert could be included to ensure that the requested dual optimizer supports the flag.

    ⚠ This change would break compatibility with versions of Pytorch prior to 1.12.

    Motivation

    Manually flipping gradients immediately after calculating them (thus ensuring that this happens before calls to dual_optimizer.step()) is error prone. Moreover, keeping track of the fact that gradients have a sign flipped is inconvenient.

    By implementing this change we would adopt the official Pytorch approach for performing ascent steps.

    Alternatives

    The current implementation is functional.

    References

    • https://github.com/pytorch/pytorch/issues/68052
    enhancement 
    opened by juan43ramirez 1
A super lightweight Lagrangian model for calculating millions of trajectories using ERA5 data

Easy-ERA5-Trck Easy-ERA5-Trck Galleries Install Usage Repository Structure Module Files Version iteration Easy-ERA5-Trck is a super lightweight Lagran

Zhenning Li 26 Nov 19, 2022
PPO Lagrangian in JAX

PPO Lagrangian in JAX This repository implements PPO in JAX. Implementation is tested on the safety-gym benchmark. Usage Install dependencies using th

Karush Suri 2 Sep 14, 2022
Official implementation of the MM'21 paper Constrained Graphic Layout Generation via Latent Optimization

[MM'21] Constrained Graphic Layout Generation via Latent Optimization This repository provides the official code for the paper "Constrained Graphic La

Kotaro Kikuchi 73 Dec 27, 2022
A semismooth Newton method for elliptic PDE-constrained optimization

sNewton4PDEOpt The Python module implements a semismooth Newton method for solving finite-element discretizations of the strongly convex, linear ellip

null 2 Dec 8, 2022
Official PyTorch implementation of the paper "Deep Constrained Least Squares for Blind Image Super-Resolution", CVPR 2022.

Deep Constrained Least Squares for Blind Image Super-Resolution [Paper] This is the official implementation of 'Deep Constrained Least Squares for Bli

MEGVII Research 141 Dec 30, 2022
PICARD - Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models

This is the official implementation of the following paper: Torsten Scholak, Nathan Schucher, Dzmitry Bahdanau. PICARD - Parsing Incrementally for Con

ElementAI 217 Jan 1, 2023
Locally Constrained Self-Attentive Sequential Recommendation

LOCKER This is the pytorch implementation of this paper: Locally Constrained Self-Attentive Sequential Recommendation. Zhankui He, Handong Zhao, Zhe L

Zhankui (Aaron) He 8 Jul 30, 2022
Prototypical python implementation of the trust-region algorithm presented in Sequential Linearization Method for Bound-Constrained Mathematical Programs with Complementarity Constraints by Larson, Leyffer, Kirches, and Manns.

Prototypical python implementation of the trust-region algorithm presented in Sequential Linearization Method for Bound-Constrained Mathematical Programs with Complementarity Constraints by Larson, Leyffer, Kirches, and Manns.

null 3 Dec 2, 2022
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)

scikit-opt Swarm Intelligence in Python (Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Algorithm, Immune Algorithm,A

郭飞 3.7k Jan 3, 2023
Racing line optimization algorithm in python that uses Particle Swarm Optimization.

Racing Line Optimization with PSO This repository contains a racing line optimization algorithm in python that uses Particle Swarm Optimization. Requi

Parsa Dahesh 6 Dec 14, 2022
A research toolkit for particle swarm optimization in Python

PySwarms is an extensible research toolkit for particle swarm optimization (PSO) in Python. It is intended for swarm intelligence researchers, practit

Lj Miranda 1k Dec 30, 2022
Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit

CNTK Chat Windows build status Linux build status The Microsoft Cognitive Toolkit (https://cntk.ai) is a unified deep learning toolkit that describes

Microsoft 17.3k Dec 29, 2022
Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit

CNTK Chat Windows build status Linux build status The Microsoft Cognitive Toolkit (https://cntk.ai) is a unified deep learning toolkit that describes

Microsoft 17k Feb 11, 2021
A lightweight Python-based 3D network multi-agent simulator. Uses a cell-based congestion model. Calculates risk, loudness and battery capacities of the agents. Suitable for 3D network optimization tasks.

AMAZ3DSim AMAZ3DSim is a lightweight python-based 3D network multi-agent simulator. It uses a cell-based congestion model. It calculates risk, battery

Daniel Hirsch 13 Nov 4, 2022
Official PyTorch code of DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context Graph and Relation-based Optimization (ICCV 2021 Oral).

DeepPanoContext (DPC) [Project Page (with interactive results)][Paper] DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context G

Cheng Zhang 66 Nov 16, 2022
PIKA: a lightweight speech processing toolkit based on Pytorch and (Py)Kaldi

PIKA: a lightweight speech processing toolkit based on Pytorch and (Py)Kaldi PIKA is a lightweight speech processing toolkit based on Pytorch and (Py)

null 336 Nov 25, 2022
MMGeneration is a powerful toolkit for generative models, based on PyTorch and MMCV.

Documentation: https://mmgeneration.readthedocs.io/ Introduction English | 简体中文 MMGeneration is a powerful toolkit for generative models, especially f

OpenMMLab 1.3k Dec 29, 2022
MWPToolkit is a PyTorch-based toolkit for Math Word Problem (MWP) solving.

MWPToolkit is a PyTorch-based toolkit for Math Word Problem (MWP) solving. It is a comprehensive framework for research purpose that integrates popular MWP benchmark datasets and typical deep learning-based MWP algorithms.

null 119 Jan 4, 2023
This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

BUPT GAMMA Lab 519 Jan 2, 2023