Skip to content

Commit

Permalink
Deploying to gh-pages from @ 141fadd 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Mar 1, 2024
1 parent b5d5bbb commit fc3db8d
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: d3d219370363fbf38c2d03b35c89ff79
config: c9b0f76e7e51b1e3f05a0e0dd5d79c0e
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/getting-started/tutorials/02_construct_simple_pc.doctree
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/763344228ae6bc253ed1a6cf586aa30d/tutorials_python.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
":code:`ms` defines a product node vector where every node have two children: the first child is a node in :code:`ni0` and the second child is a node in :code:`ni1`.\n:code:`edge_ids` specifies which child nodes do every node in :code:`ms` connects to. Specifically, :code:`edge_ids` has size :code:`[# product node blocks, # child node vectors]`, so in this case, it should has size :code:`[4, 2]`.\nThe semantic of :code:`edge_ids[i,j]` is:\nthe $i$th product node block connects to the `edge_ids[i,j]`th node block in the jth child node vector (assume we always count from 0).\nFor example, `edge_ids[1,0] = 1` means that the 1th product node block connects to the 1th node block in :code:`ni0`.\n\nWe require the node vectors fed to :code:`pyjuice.multiply` have the same :code:`block_size`. And the block size of the output product node vector is also the same with that of the inputs.\nWe do not need to specify the number of node blocks (e.g., using :code:`num_node_blocks`) since it is equal to :code:`edge_ids.size(0)`.\nFor :code:`pyjuice.multiply`, if two node blocks are connected (as defined by :code:`edge_ids`), we assume the $i$th node in the (parent) product node block is connected to the $i$th node in the child node block.\n\nWhen we do not provide the :code:`edge_ids`, PyJuice assumes it to be the following (we can only use this shortcut when the child node vectors have the same :code:`num_node_blocks` and :code:`block_size`):\n\n"
":code:`ms` defines a product node vector where every node have two children: the first child is a node in :code:`ni0` and the second child is a node in :code:`ni1`.\n:code:`edge_ids` specifies which child nodes do every node in :code:`ms` connects to. Specifically, :code:`edge_ids` has size :code:`[# product node blocks, # child node vectors]`, so in this case, it should has size :code:`[4, 2]`.\nThe semantic of :code:`edge_ids[i,j]` is:\nthe $i$th \nproduct node block connects to the $edge_ids[i,j]$th \nnode block in the jth child node vector (assume we always count from 0).\nFor example, `edge_ids[1,0] = 1` means that the 1th product node block connects to the 1th node block in :code:`ni0`.\n\nWe require the node vectors fed to :code:`pyjuice.multiply` have the same :code:`block_size`. And the block size of the output product node vector is also the same with that of the inputs.\nWe do not need to specify the number of node blocks (e.g., using :code:`num_node_blocks`) since it is equal to :code:`edge_ids.size(0)`.\nFor :code:`pyjuice.multiply`, if two node blocks are connected (as defined by :code:`edge_ids`), we assume the $i$th node in the (parent) product node block is connected to the $i$th node in the child node block.\n\nWhen we do not provide the :code:`edge_ids`, PyJuice assumes it to be the following (we can only use this shortcut when the child node vectors have the same :code:`num_node_blocks` and :code:`block_size`):\n\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
# :code:`ms` defines a product node vector where every node have two children: the first child is a node in :code:`ni0` and the second child is a node in :code:`ni1`.
# :code:`edge_ids` specifies which child nodes do every node in :code:`ms` connects to. Specifically, :code:`edge_ids` has size :code:`[# product node blocks, # child node vectors]`, so in this case, it should has size :code:`[4, 2]`.
# The semantic of :code:`edge_ids[i,j]` is:
# the :math:`i`th product node block connects to the `edge_ids[i,j]`th node block in the jth child node vector (assume we always count from 0).
# the :math:`i`th
# product node block connects to the :math:`edge_ids[i,j]`th
# node block in the jth child node vector (assume we always count from 0).
# For example, `edge_ids[1,0] = 1` means that the 1th product node block connects to the 1th node block in :code:`ni0`.
#
# We require the node vectors fed to :code:`pyjuice.multiply` have the same :code:`block_size`. And the block size of the output product node vector is also the same with that of the inputs.
Expand Down
18 changes: 10 additions & 8 deletions _sources/getting-started/tutorials/02_construct_simple_pc.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ Let us define another input node vector and a product node vector that take the
ms = juice.multiply(ni0, ni1, edge_ids = edge_ids)
.. GENERATED FROM PYTHON SOURCE LINES 49-60
.. GENERATED FROM PYTHON SOURCE LINES 49-62
:code:`ms` defines a product node vector where every node have two children: the first child is a node in :code:`ni0` and the second child is a node in :code:`ni1`.
:code:`edge_ids` specifies which child nodes do every node in :code:`ms` connects to. Specifically, :code:`edge_ids` has size :code:`[# product node blocks, # child node vectors]`, so in this case, it should has size :code:`[4, 2]`.
The semantic of :code:`edge_ids[i,j]` is:
the :math:`i`th product node block connects to the `edge_ids[i,j]`th node block in the jth child node vector (assume we always count from 0).
the :math:`i`th
product node block connects to the :math:`edge_ids[i,j]`th
node block in the jth child node vector (assume we always count from 0).
For example, `edge_ids[1,0] = 1` means that the 1th product node block connects to the 1th node block in :code:`ni0`.

We require the node vectors fed to :code:`pyjuice.multiply` have the same :code:`block_size`. And the block size of the output product node vector is also the same with that of the inputs.
Expand All @@ -101,7 +103,7 @@ For :code:`pyjuice.multiply`, if two node blocks are connected (as defined by :c

When we do not provide the :code:`edge_ids`, PyJuice assumes it to be the following (we can only use this shortcut when the child node vectors have the same :code:`num_node_blocks` and :code:`block_size`):

.. GENERATED FROM PYTHON SOURCE LINES 60-65
.. GENERATED FROM PYTHON SOURCE LINES 62-67
.. code-block:: Python
Expand All @@ -111,16 +113,16 @@ When we do not provide the :code:`edge_ids`, PyJuice assumes it to be the follow
edge_ids = torch.arange(0, num_node_blocks)[:,None].repeat(1, num_child_node_vectors)
.. GENERATED FROM PYTHON SOURCE LINES 66-68
.. GENERATED FROM PYTHON SOURCE LINES 68-70
Sum nodes
---------

.. GENERATED FROM PYTHON SOURCE LINES 70-71
.. GENERATED FROM PYTHON SOURCE LINES 72-73
Finally, we introduce :code:`pyjuice.summate`, which is used to define sum node vectors.

.. GENERATED FROM PYTHON SOURCE LINES 71-75
.. GENERATED FROM PYTHON SOURCE LINES 73-77
.. code-block:: Python
Expand All @@ -129,7 +131,7 @@ Finally, we introduce :code:`pyjuice.summate`, which is used to define sum node
ns = juice.summate(ms, num_node_blocks = 6, block_size = 2, edge_ids = edge_ids)
.. GENERATED FROM PYTHON SOURCE LINES 76-87
.. GENERATED FROM PYTHON SOURCE LINES 78-89
Similar to :code:`pyjuice.multiply`, the positional arguments to :code:`pyjuice.summate` are the list of input node vectors (here we only provide :code:`ms`).
:code:`num_node_blocks` and :code:`block_size` are the number of node blocks and the size of each node block, respectively.
Expand All @@ -143,7 +145,7 @@ That is, in the case where both :code:`ns` and :code:`ms` have block size 2, eve

If :code:`edge_ids` is not provided, we assume that all nodes in the sum node vector are connected to all child nodes:

.. GENERATED FROM PYTHON SOURCE LINES 87-88
.. GENERATED FROM PYTHON SOURCE LINES 89-90
.. code-block:: Python
Expand Down
4 changes: 3 additions & 1 deletion getting-started/tutorials/02_construct_simple_pc.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ <h2>Product nodes<a class="headerlink" href="#product-nodes" title="Link to this
<p><code class="code docutils literal notranslate"><span class="pre">ms</span></code> defines a product node vector where every node have two children: the first child is a node in <code class="code docutils literal notranslate"><span class="pre">ni0</span></code> and the second child is a node in <code class="code docutils literal notranslate"><span class="pre">ni1</span></code>.
<code class="code docutils literal notranslate"><span class="pre">edge_ids</span></code> specifies which child nodes do every node in <code class="code docutils literal notranslate"><span class="pre">ms</span></code> connects to. Specifically, <code class="code docutils literal notranslate"><span class="pre">edge_ids</span></code> has size <code class="code docutils literal notranslate"><span class="pre">[#</span> <span class="pre">product</span> <span class="pre">node</span> <span class="pre">blocks,</span> <span class="pre">#</span> <span class="pre">child</span> <span class="pre">node</span> <span class="pre">vectors]</span></code>, so in this case, it should has size <code class="code docutils literal notranslate"><span class="pre">[4,</span> <span class="pre">2]</span></code>.
The semantic of <code class="code docutils literal notranslate"><span class="pre">edge_ids[i,j]</span></code> is:
the <span class="math notranslate nohighlight">\(i`th product node block connects to the `edge_ids[i,j]`th node block in the jth child node vector (assume we always count from 0).
the <span class="math notranslate nohighlight">\(i`th
product node block connects to the :math:`edge_ids[i,j]`th
node block in the jth child node vector (assume we always count from 0).
For example, `edge_ids[1,0] = 1\)</span> means that the 1th product node block connects to the 1th node block in <code class="code docutils literal notranslate"><span class="pre">ni0</span></code>.</p>
<p>We require the node vectors fed to <code class="code docutils literal notranslate"><span class="pre">pyjuice.multiply</span></code> have the same <code class="code docutils literal notranslate"><span class="pre">block_size</span></code>. And the block size of the output product node vector is also the same with that of the inputs.
We do not need to specify the number of node blocks (e.g., using <code class="code docutils literal notranslate"><span class="pre">num_node_blocks</span></code>) since it is equal to <code class="code docutils literal notranslate"><span class="pre">edge_ids.size(0)</span></code>.
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit fc3db8d

Please sign in to comment.