Skip to content

Commit 034e8a2

Browse files
authored
Update docs to describe models (#31)
* . * . * .
1 parent 584e0d0 commit 034e8a2

12 files changed

+721
-125
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cache: pip
55
before_install:
66
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
77
- sudo apt-get update
8+
- sudo apt-get install pandoc
89
- pip install -r requirements.txt
910
- pip install -r requirements.dev.txt
1011
- pip install coveralls

docs/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ sphinx-jinja
33
sphinxcontrib-bibtex
44
sphinx-rtd-theme
55
recommonmark
6+
nbsphinx
7+
pandoc

docs/source/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

docs/source/README_files

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README_files/

docs/source/advanced.rst

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
3+
4+
============================
5+
Advanced Usage: Semirings
6+
============================
7+
8+
All of the distributional code is implemented through a series of
9+
semiring objects. These are passed through dynamic programming
10+
backends to compute the distributions.
11+
12+
13+
Standard Semirings
14+
===================
15+
16+
.. autoclass:: torch_struct.LogSemiring
17+
.. autoclass:: torch_struct.StdSemiring
18+
.. autoclass:: torch_struct.MaxSemiring
19+
20+
Higher-Order Semirings
21+
=========================
22+
.. autoclass:: torch_struct.EntropySemiring
23+
24+
Sampling Semirings
25+
===================
26+
27+
.. autoclass:: torch_struct.SampledSemiring
28+
.. autoclass:: torch_struct.MultiSampledSemiring
29+
30+
31+
Dynamic Programming
32+
===================
33+
34+
.. autoclass:: torch_struct.LinearChain
35+
.. autoclass:: torch_struct.SemiMarkov
36+
.. autoclass:: torch_struct.DepTree
37+
.. autoclass:: torch_struct.CKY

docs/source/conf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
'sphinx.ext.napoleon',
3131
'sphinxcontrib.jinja',
3232
'sphinxcontrib.bibtex',
33-
'sphinx.ext.intersphinx'
33+
'sphinx.ext.intersphinx',
34+
'recommonmark',
35+
'nbsphinx'
3436
]
3537

3638

docs/source/index.rst

+8-124
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,19 @@
1-
1+
=================
22
PyTorch-Struct
3-
==========================================
3+
=================
44

55
.. toctree::
6-
:maxdepth: 2
6+
:maxdepth: 3
77
:caption: Contents:
88

9-
Introduction
10-
============
11-
12-
A library for structured prediction.
13-
14-
15-
16-
Distributional Interface
17-
========================
18-
19-
20-
The main interface is through a structured distribution objects. Each
21-
of these implement a conditional random field over a class of
22-
structures. Roughly, these represent specialized softmax's over
23-
exponentially sized spaces. Each distribution object takes in
24-
log_potentials (generalized logits) and can return properties of the
25-
distribution. The properties of interest are,
26-
27-
* Partition (e.g. logsumexp)
28-
* Marginals (e.g. softmax)
29-
* Argmax
30-
* Entropy
31-
* Samples
32-
* to_event / from_event (adapters)
33-
34-
35-
.. autoclass:: torch_struct.StructDistribution
36-
:members:
37-
38-
Linear Chain
39-
--------------
40-
41-
.. autoclass:: torch_struct.LinearChainCRF
42-
43-
44-
Semi-Markov
45-
--------------
46-
47-
.. autoclass:: torch_struct.SemiMarkovCRF
48-
49-
50-
Dependency Tree
51-
----------------
52-
53-
54-
.. autoclass:: torch_struct.DependencyCRF
55-
56-
57-
Binary Tree
58-
--------------
59-
60-
.. autoclass:: torch_struct.TreeCRF
61-
62-
Context-Free Grammar
63-
---------------------
64-
65-
.. autoclass:: torch_struct.SentCFG
66-
67-
68-
69-
70-
71-
Networks
72-
===========
73-
74-
Common structured networks.
75-
76-
77-
.. autoclass:: torch_struct.networks.TreeLSTM
78-
79-
.. autoclass:: torch_struct.networks.NeuralCFG
80-
81-
.. autoclass:: torch_struct.networks.SpanLSTM
82-
83-
84-
Data
85-
====
86-
87-
Datasets for common structured prediction tasks.
88-
89-
.. autoclass:: torch_struct.data.ConllXDataset
90-
.. autoclass:: torch_struct.data.ListOpsDataset
91-
92-
93-
Advanced Usage: Semirings
94-
=========================
95-
96-
All of the distributional code is implemented through a series of
97-
semiring objects. These are passed through dynamic programming
98-
backends to compute the distributions.
99-
100-
101-
Standard Semirings
102-
------------------
103-
104-
.. autoclass:: torch_struct.LogSemiring
105-
.. autoclass:: torch_struct.StdSemiring
106-
.. autoclass:: torch_struct.MaxSemiring
107-
108-
Higher-Order Semirings
109-
----------------------
110-
.. autoclass:: torch_struct.EntropySemiring
111-
112-
Sampling Semirings
113-
----------------------
114-
115-
.. autoclass:: torch_struct.SampledSemiring
116-
.. autoclass:: torch_struct.MultiSampledSemiring
117-
118-
119-
Dynamic Programming
120-
-------------------
121-
122-
.. autoclass:: torch_struct.LinearChain
123-
.. autoclass:: torch_struct.SemiMarkov
124-
.. autoclass:: torch_struct.DepTree
125-
.. autoclass:: torch_struct.CKY
126-
9+
README
10+
model
11+
networks
12+
advanced
13+
refs
12714

12815

129-
References
130-
==========
13116

132-
.. bibliography:: refs.bib
13317

13418

13519
Indices and tables

0 commit comments

Comments
 (0)