Skip to content

Commit

Permalink
Update docs (#33)
Browse files Browse the repository at this point in the history
* Fix typo

* Flip costs definition to features x weights
  • Loading branch information
bentaculum committed May 3, 2023
1 parent f050187 commit 77e3956
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Installation
This will install ``motile`` with all required dependencies, including binaries
for two discrete optimizers:

1. The `Gurobi Optimizer <https://www.gurobi.com/>`_. This is a comercial
1. The `Gurobi Optimizer <https://www.gurobi.com/>`_. This is a commercial
solver, which requires a valid license. Academic licenses are provided for
free, see `here
<https://www.gurobi.com/academia/academic-program-and-licenses/>`_ for how
Expand Down
16 changes: 8 additions & 8 deletions docs/source/learning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ model is:
solver.add_costs(EdgeSelection(weight=-2, attribute="score", constant=1))
solver.add_costs(Appear(constant=1))

Each of those costs is calculated as the product of `weights` and `features`:
Each of those costs is calculated as the product of `features` and `weights`:

:class:`motile.costs.NodeSelection` and :class:`motile.costs.EdgeSelection`
each have a weight (given as argument ``weight``) by which to scale a node or
Expand All @@ -108,7 +108,7 @@ More generally, the cost :math:`c_y` of a variable :math:`y` is
.. math::
\def\vct#1{\mathbf{#1}}
c_y = \vct{w}^\intercal\vct{f}_y
c_y = \vct{f}_y^\intercal\vct{w}
\text{.}
The variable :math:`y` can be an indicator for the selection of a node, the
Expand All @@ -117,17 +117,17 @@ to the solver.

In the example above, the :class:`motile.variables.EdgeSelected` variable
(which is the target of the cost :class:`motile.costs.EdgeSelection`), has the
follwing weights and features:
following features and weights:

.. math::
\vct{w}
= \begin{pmatrix} w_\text{attr} \\ w_\text{const} \end{pmatrix}
= \begin{pmatrix} -2 \\ 1 \end{pmatrix}
\vct{f}_e
= \begin{pmatrix}\text{attr} \\ 1.0 \end{pmatrix}
\;\;\;
\text{and}
\;\;\;
\vct{f}_e
= \begin{pmatrix}\text{attr} \\ 1.0 \end{pmatrix}
\vct{w}
= \begin{pmatrix} w_\text{attr} \\ w_\text{const} \end{pmatrix}
= \begin{pmatrix} -2 \\ 1 \end{pmatrix}
\text{,}
where :math:`\text{attr}` is the value of the attribute ``score`` of edge :math:`e`.
Expand Down

0 comments on commit 77e3956

Please sign in to comment.