Skip to content

Commit 70c3c2f

Browse files
committed
docs tweaks
1 parent 7c7874d commit 70c3c2f

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ _KLay is a Python library for evaluating sparse arithmetic circuits on the GPU._
55
To get started, install KLay using pip and check out [the documentation](https://klaycircuits.readthedocs.io/en/latest/).
66

77
```bash
8-
pip install git+https://github.com/ML-KULeuven/klay
8+
pip install klaycircuits
99
```
1010

1111
Features include:
12-
- Evaluation in Jax and PyTorch, on CPU and GPU.
12+
- Evaluation in Jax or PyTorch, on CPU or GPU.
1313
- Loading SDD and d-DNNF circuits compiled by PySDD or D4.
1414
- Evaluation in various semirings (e.g. real, log, tropical).
1515
- Propagating constants and merging duplicate nodes.

docs/index.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
.. KLay documentation master file, created by
2-
sphinx-quickstart on Fri Mar 14 13:16:49 2025.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
61
KLay Documentation
72
==================
83

9-
KLay is a Python library for accelerating inference on sparse arithmetic circuits.
4+
`KLay is a Python library for accelerating inference on sparse arithmetic circuits.`
5+
6+
Get started using the :ref:`quickstart`!
7+
8+
.. image:: _static/scatter_reduce.png
9+
:width: 350
10+
:align: center
1011

1112
At its core, KLay transforms sparse directed acyclic graphs into layers that can be executed in parallel.
1213
The design of KLay is described in our paper `KLay: Accelerating Arithmetic Circuits for Neurosymbolic AI <https://arxiv.org/pdf/2410.11415>`_, published at ICLR 2025.
1314

14-
.. image:: _static/scatter_reduce.png
15-
:width: 400
1615

1716
----
1817

docs/quickstart.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _quickstart:
2+
13
Quick Start Guide
24
=================
35

@@ -9,9 +11,9 @@ KLay supports Linux, Mac and Windows. Make sure you have installed Python, and i
911

1012
>>> pip install klaycircuits
1113

12-
To build the latest version of KLay from source, download the repo and run:
14+
To install the latest development version of KLay, you can install from the Github repo.
1315

14-
>>> pip install .
16+
>>> pip install git+https://github.com/ML-KULeuven/klay
1517

1618

1719
Usage
@@ -22,27 +24,23 @@ For more information, check out the :ref:`circuit_construction`.
2224

2325
.. code-block:: Python
2426
25-
from klaycircuits import Circuit
27+
import klay
2628
27-
circuit = Circuit()
29+
circuit = klay.Circuit()
2830
circuit.add_sdd(sdd_node)
2931
3032
Now that we have the circuit, we can evaluate it. To do this, we first turn the circuit into a PyTorch module.
3133

3234
.. code-block:: Python
3335
34-
import torch
35-
3636
module = circuit.to_torch_module()
37-
module = module.to("cuda:0")
3837
39-
We can use our circuit as any other PyTorch module.
40-
The input should be a tensor with the weights for each literal, and the output is the result of evaluating circuit.
38+
The input to the module should be a tensor with the weights for each literal.
4139
For more details, see the :ref:`circuit_eval`.
4240

4341
.. code-block:: Python
4442
45-
weights = torch.tensor([...], device="cuda:0")
43+
weights = torch.tensor([...])
4644
result = module(weights)
4745
result.backward()
4846

0 commit comments

Comments
 (0)