Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBoTang committed Apr 24, 2024
1 parent 74f3db8 commit 99c462d
Show file tree
Hide file tree
Showing 78 changed files with 1,453 additions and 380 deletions.
Binary file modified docs/build/doctrees/autoapi/pyepo/data/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/abcmodule/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/blackbox/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/contrastive/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/perturbed/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/rank/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/spoplus/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/func/utlis/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/model/grb/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/autoapi/pyepo/model/grb/tsp/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/examples/data.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/examples/function.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/examples/model.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/examples/training.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/install.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/modules/pyepo.data.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/modules/pyepo.func.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/content/modules/pyepo.model.grb.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
1 change: 1 addition & 0 deletions docs/build/html/_sources/autoapi/pyepo/data/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Submodules

dataset/index.rst
knapsack/index.rst
portfolio/index.rst
shortestpath/index.rst
tsp/index.rst

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,23 @@ Classes



.. py:class:: optModule(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: optModule(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`torch.nn.Module`

An abstract module for the learning to rank losses, which measure the difference in how the predicted cost
vector and the true cost vector rank a pool of feasible solutions.

.. py:method:: forward(pred_cost, true_cost, reduction='mean')
.. py:method:: forward(pred_cost, true_cost)
:abstractmethod:

Forward pass


.. py:method:: _update_solution_pool(sol)
Add new solutions to solution pool



22 changes: 2 additions & 20 deletions docs/build/html/_sources/autoapi/pyepo/func/blackbox/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,13 @@ Classes

A autograd function for differentiable black-box optimizer

.. py:method:: forward(ctx, pred_cost, lambd, optmodel, processes, pool, solve_ratio, module)
.. py:method:: forward(ctx, pred_cost, module)
:staticmethod:

Forward pass for DBB

:param pred_cost: a batch of predicted values of the cost
:type pred_cost: torch.tensor
:param lambd: a hyperparameter for differentiable block-box to control interpolation degree
:type lambd: float
:param optmodel: an PyEPO optimization model
:type optmodel: optModel
:param processes: number of processors, 1 for single-core, 0 for all of cores
:type processes: int
:param pool: process pool object
:type pool: ProcessPool
:param solve_ratio: the ratio of new solutions computed during training
:type solve_ratio: float
:param module: blackboxOpt module
:type module: optModule

Expand Down Expand Up @@ -119,21 +109,13 @@ Classes

A autograd function for differentiable black-box optimizer

.. py:method:: forward(ctx, pred_cost, optmodel, processes, pool, solve_ratio, module)
.. py:method:: forward(ctx, pred_cost, module)
:staticmethod:

Forward pass for NID

:param pred_cost: a batch of predicted values of the cost
:type pred_cost: torch.tensor
:param optmodel: an PyEPO optimization model
:type optmodel: optModel
:param processes: number of processors, 1 for single-core, 0 for all of cores
:type processes: int
:param pool: process pool object
:type pool: ProcessPool
:param solve_ratio: the ratio of new solutions computed during training
:type solve_ratio: float
:param module: blackboxOpt module
:type module: optModule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Classes



.. py:class:: NCE(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: NCE(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -38,13 +38,13 @@ Classes

Reference: <https://www.ijcai.org/proceedings/2021/390>

.. py:method:: forward(pred_cost, true_sol, reduction='mean')
.. py:method:: forward(pred_cost, true_sol)
Forward pass



.. py:class:: contrastiveMAP(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: contrastiveMAP(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -59,7 +59,7 @@ Classes

Reference: <https://www.ijcai.org/proceedings/2021/390>

.. py:method:: forward(pred_cost, true_sol, reduction='mean')
.. py:method:: forward(pred_cost, true_sol)
Forward pass

Expand Down
59 changes: 42 additions & 17 deletions docs/build/html/_sources/autoapi/pyepo/func/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Classes
pyepo.func.perturbedOpt
pyepo.func.perturbedFenchelYoung
pyepo.func.implicitMLE
pyepo.func.adaptiveImplicitMLE
pyepo.func.NCE
pyepo.func.contrastiveMAP
pyepo.func.listwiseLTR
Expand All @@ -47,7 +48,7 @@ Classes



.. py:class:: SPOPlus(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: SPOPlus(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -64,7 +65,7 @@ Classes

Reference: <https://doi.org/10.1287/mnsc.2020.3922>

.. py:method:: forward(pred_cost, true_cost, true_sol, true_obj, reduction='mean')
.. py:method:: forward(pred_cost, true_cost, true_sol, true_obj)
Forward pass

Expand Down Expand Up @@ -142,7 +143,7 @@ Classes



.. py:class:: perturbedFenchelYoung(optmodel, n_samples=10, sigma=1.0, processes=1, seed=135, solve_ratio=1, dataset=None)
.. py:class:: perturbedFenchelYoung(optmodel, n_samples=10, sigma=1.0, processes=1, seed=135, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -160,13 +161,13 @@ Classes

Reference: <https://papers.nips.cc/paper/2020/hash/6bb56208f672af0dd65451f869fedfd9-Abstract.html>

.. py:method:: forward(pred_cost, true_sol, reduction='mean')
.. py:method:: forward(pred_cost, true_sol)
Forward pass



.. py:class:: implicitMLE(optmodel, n_samples=10, sigma=1.0, lambd=10, processes=1, distribution=sumGammaDistribution(kappa=5), solve_ratio=1, dataset=None)
.. py:class:: implicitMLE(optmodel, n_samples=10, sigma=1.0, lambd=10, distribution=sumGammaDistribution(kappa=5), two_sides=False, processes=1, solve_ratio=1, dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -175,11 +176,11 @@ Classes
an optimal solution in a constrained exponential family distribution via
Perturb-and-MAP.

For I-LME, it works as black-box combinatorial solvers, in which constraints
For I-MLE, it works as black-box combinatorial solvers, in which constraints
are known and fixed, but the cost vector need to be predicted from
contextual data.

The I-LME approximate gradient of optimizer smoothly. Thus, allows us to
The I-MLE approximate gradient of optimizer smoothly. Thus, allows us to
design an algorithm based on stochastic gradient descent.

Reference: <https://proceedings.neurips.cc/paper_files/paper/2021/hash/7a430339c10c642c4b2251756fd1b484-Abstract.html>
Expand All @@ -190,7 +191,31 @@ Classes



.. py:class:: NCE(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: adaptiveImplicitMLE(optmodel, n_samples=10, sigma=1.0, distribution=sumGammaDistribution(kappa=5), two_sides=False, processes=1, solve_ratio=1, dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`

An autograd module for Adaptive Implicit Maximum Likelihood Estimator, which
adaptively choose hyperparameter λ and yield an optimal solution in a
constrained exponential family distribution via Perturb-and-MAP.

For AI-MLE, it works as black-box combinatorial solvers, in which constraints
are known and fixed, but the cost vector need to be predicted from
contextual data.

The AI-MLE approximate gradient of optimizer smoothly. Thus, allows us to
design an algorithm based on stochastic gradient descent.

Reference: <https://ojs.aaai.org/index.php/AAAI/article/view/26103>

.. py:method:: forward(pred_cost)
Forward pass



.. py:class:: NCE(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -205,13 +230,13 @@ Classes

Reference: <https://www.ijcai.org/proceedings/2021/390>

.. py:method:: forward(pred_cost, true_sol, reduction='mean')
.. py:method:: forward(pred_cost, true_sol)
Forward pass



.. py:class:: contrastiveMAP(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: contrastiveMAP(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -226,13 +251,13 @@ Classes

Reference: <https://www.ijcai.org/proceedings/2021/390>

.. py:method:: forward(pred_cost, true_sol, reduction='mean')
.. py:method:: forward(pred_cost, true_sol)
Forward pass



.. py:class:: listwiseLTR(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: listwiseLTR(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -248,13 +273,13 @@ Classes

Reference: <https://proceedings.mlr.press/v162/mandi22a.html>

.. py:method:: forward(pred_cost, true_cost, reduction='mean')
.. py:method:: forward(pred_cost, true_cost)
Forward pass



.. py:class:: pairwiseLTR(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: pairwiseLTR(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -270,13 +295,13 @@ Classes

Reference: <https://proceedings.mlr.press/v162/mandi22a.html>

.. py:method:: forward(pred_cost, true_cost, reduction='mean')
.. py:method:: forward(pred_cost, true_cost)
Forward pass



.. py:class:: pointwiseLTR(optmodel, processes=1, solve_ratio=1, dataset=None)
.. py:class:: pointwiseLTR(optmodel, processes=1, solve_ratio=1, reduction='mean', dataset=None)
Bases: :py:obj:`pyepo.func.abcmodule.optModule`
Expand All @@ -293,7 +318,7 @@ Classes

Reference: <https://proceedings.mlr.press/v162/mandi22a.html>

.. py:method:: forward(pred_cost, true_cost, reduction='mean')
.. py:method:: forward(pred_cost, true_cost)
Forward pass

Expand Down
Loading

0 comments on commit 99c462d

Please sign in to comment.