Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
joserapa98 committed Apr 18, 2024
2 parents 8ccad6d + bb4cb75 commit 610c878
Show file tree
Hide file tree
Showing 65 changed files with 5,424 additions and 1,861 deletions.
154 changes: 77 additions & 77 deletions docs/_build/doctest/output.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
Results of doctest builder run on 2024-04-14 01:59:36
Results of doctest builder run on 2024-04-18 22:09:14
=====================================================

Document: embeddings
--------------------
1 items passed all tests:
35 tests in default
35 tests in 1 items.
35 passed and 0 failed.
45 tests in default
45 tests in 1 items.
45 passed and 0 failed.
Test passed.

Document: models
----------------
1 items passed all tests:
115 tests in default
115 tests in 1 items.
115 passed and 0 failed.
Test passed.

Document: operations
--------------------
1 items passed all tests:
186 tests in default
186 tests in 1 items.
186 passed and 0 failed.
118 tests in default
118 tests in 1 items.
118 passed and 0 failed.
Test passed.

Document: components
Expand All @@ -35,24 +27,24 @@ Expected:
tensor([[-0.2799, -0.4383, -0.8387],
[ 1.6225, -0.3370, -1.2316]])
Got:
tensor([[ 0.2628, -0.6672, -0.9051],
[-0.6796, -0.4245, -0.5780]])
tensor([[-0.4871, -0.3151, -0.9507],
[ 0.2821, -2.0437, -0.1693]])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.sum()
Expected:
tensor(-1.5029)
Got:
tensor(-2.9916)
tensor(-3.6837)
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.sum('left')
Expected:
tensor([ 1.3427, -0.7752, -2.0704])
Got:
tensor([-0.4168, -1.0916, -1.4831])
tensor([-0.2050, -2.3588, -1.1199])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
Expand All @@ -61,24 +53,24 @@ Expected:
tensor([[ 1.4005, -0.0521, -1.2091],
[ 1.9844, 0.3513, -0.5920]])
Got:
tensor([[-0.5314, -0.7805, -0.6475],
[-0.1279, 0.7409, 0.5816]])
tensor([[ 0.9150, -0.8719, -0.6474],
[ 0.6041, 1.1371, 1.9903]])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.mean()
Expected:
tensor(0.3139)
Got:
tensor(-0.1275)
tensor(0.5212)
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.mean('left')
Expected:
tensor([ 1.6925, 0.1496, -0.9006])
Got:
tensor([-0.3296, -0.0198, -0.0330])
tensor([0.7595, 0.1326, 0.6714])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
Expand All @@ -87,24 +79,24 @@ Expected:
tensor([[ 0.2111, -0.9551, -0.7812],
[ 0.2254, 0.3381, -0.2461]])
Got:
tensor([[-1.8500, -0.4944, 0.5940],
[-0.9353, -0.6008, -0.4320]])
tensor([[ 0.1216, 0.8937, 0.3488],
[-0.0591, 0.2322, 0.4997]])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.std()
Expected:
tensor(0.5567)
Got:
tensor(0.7922)
tensor(0.3319)
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.std('left')
Expected:
tensor([0.0101, 0.9145, 0.3784])
Got:
tensor([0.6468, 0.0752, 0.7255])
tensor([0.1278, 0.4678, 0.1068])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
Expand All @@ -113,24 +105,24 @@ Expected:
tensor([[ 1.5570, 1.8441, -0.0743],
[ 0.4572, 0.7592, 0.6356]])
Got:
tensor([[ 1.5611, -0.1317, -1.2049],
[-0.8746, 0.7130, -1.7564]])
tensor([[-0.3278, -0.6991, -0.2752],
[ 0.1391, 0.8034, 0.7103]])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.norm()
Expected:
tensor(2.6495)
Got:
tensor(2.8748)
tensor(1.3569)
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
node.norm(axis='left')
Expected:
tensor([1.6227, 1.9942, 0.6399])
Got:
tensor([1.7894, 0.7251, 2.1299])
tensor([0.3561, 1.0650, 0.7617])
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
Expand Down Expand Up @@ -161,17 +153,17 @@ Got:
Node(
name: my_node
tensor:
tensor([[[-0.2232, -0.0576],
[-2.0650, -1.6126],
[ 0.3369, -0.6012],
[-1.5875, -0.0953],
[-0.3129, 0.5625]],
tensor([[[ 0.5755, -0.2232],
[ 0.0960, 0.7366],
[ 0.0692, 0.5901],
[-1.0679, 0.3018],
[ 1.3321, -0.9018]],

[[ 2.0660, -0.9154],
[ 0.0753, 0.9608],
[ 0.7278, -0.2497],
[ 0.9090, -0.5242],
[ 1.4432, 2.6149]]])
[[ 0.4797, 0.3139],
[ 0.1743, 0.2144],
[-0.0058, -1.5278],
[ 0.6321, -3.0880],
[ 2.0286, -0.9725]]])
axes:
[left
input
Expand Down Expand Up @@ -210,17 +202,17 @@ Got:
Node(
name: node
tensor:
tensor([[[-0.0399, 0.5602],
[-1.3402, 1.1127],
[ 0.0795, -1.6100],
[ 2.3359, 1.8294],
[-0.2258, -0.2929]],
tensor([[[-0.3102, 0.6564],
[-0.3489, 0.7021],
[ 0.3633, 0.7338],
[-1.4228, 0.2670],
[-1.0312, 0.8637]],

[[ 0.2125, -1.1086],
[-0.6906, -0.8028],
[-1.4547, 0.0981],
[-1.5869, 0.2020],
[-0.5355, -0.1357]]])
[[-0.2284, -0.0338],
[-1.4974, -1.9423],
[ 0.6442, 0.5389],
[ 0.1022, 0.4674],
[ 0.0568, 0.8180]]])
axes:
[axis_0
axis_1
Expand Down Expand Up @@ -272,17 +264,17 @@ Got:
name: my_paramnode
tensor:
Parameter containing:
tensor([[[ 1.0837, 1.7036],
[-0.8799, -0.1600],
[-0.5867, -1.7778],
[ 0.1615, 1.0249],
[ 0.1880, 1.1234]],
tensor([[[-1.9965, -2.3411],
[ 1.8579, 0.0275],
[-1.4138, -0.8612],
[-1.9062, -0.0336],
[-0.5938, 0.4889]],

[[ 0.7499, -0.7739],
[-0.5278, 1.1947],
[-0.7586, -1.4460],
[-0.1016, -0.1954],
[ 0.1579, 0.0572]]], requires_grad=True)
[[-1.8927, 1.2207],
[-1.3008, 0.3132],
[-0.4851, -0.8716],
[ 0.1814, 0.2141],
[ 1.3394, 1.5221]]], requires_grad=True)
axes:
[left
input
Expand Down Expand Up @@ -323,17 +315,17 @@ Got:
name: paramnode
tensor:
Parameter containing:
tensor([[[-0.7419, 0.3802],
[ 0.4183, 0.2084],
[-0.4384, -0.6852],
[-0.2616, -0.4692],
[ 0.4573, 2.0465]],
tensor([[[-2.0722, -2.1124],
[-0.7837, -0.8056],
[ 0.9438, -0.3114],
[-1.0441, -0.3426],
[ 0.9023, -0.4975]],

[[ 0.5333, 0.6722],
[-0.9125, 0.1184],
[ 0.1689, -0.0498],
[-1.2576, 0.5516],
[-0.0805, -0.2896]]], requires_grad=True)
[[-0.4780, 0.7928],
[ 0.8449, 0.2442],
[-2.0929, 0.7116],
[ 0.7338, -1.6473],
[-0.3100, -1.2454]]], requires_grad=True)
axes:
[axis_0
axis_1
Expand All @@ -352,8 +344,8 @@ Expected:
[ 1.3371, 1.4761, 0.6551]], requires_grad=True)
Got:
Parameter containing:
tensor([[-1.4491, 0.7555, -1.2827],
[ 1.3534, -1.0071, 0.1320]], requires_grad=True)
tensor([[ 1.2550, -1.5785, -0.3669],
[ 0.9248, 0.9656, 0.0411]], requires_grad=True)
**********************************************************************
File "../tensorkrowch/components.py", line ?, in default
Failed example:
Expand Down Expand Up @@ -404,14 +396,22 @@ Got:
data_0[feature] <-> nodeA[input]])
**********************************************************************
1 items had failures:
21 of 395 in default
395 tests in 1 items.
374 passed and 21 failed.
21 of 398 in default
398 tests in 1 items.
377 passed and 21 failed.
***Test Failed*** 21 failures.

Document: operations
--------------------
1 items passed all tests:
214 tests in default
214 tests in 1 items.
214 passed and 0 failed.
Test passed.

Doctest summary
===============
731 tests
775 tests
21 failures in tests
0 failures in setup code
0 failures in cleanup code
Binary file modified docs/_build/doctrees/components.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/decompositions.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/embeddings.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/initializers.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/models.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/operations.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tutorials/2_contracting_tensor_network.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/tutorials/5_subclass_tensor_network.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.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: 63305a93c3c4aabf898dfa68c6787279
config: c72caa67f9b4991a6c17c8f5c88f410a
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; TensorKrowch 1.0.1 documentation</title>
<title>Overview: module code &#8212; TensorKrowch 1.1.0 documentation</title>

<!-- Loaded before other Sphinx assets -->
<link href="../_static/styles/theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
Expand Down
15 changes: 12 additions & 3 deletions docs/_build/html/_modules/tensorkrowch/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>tensorkrowch.components &#8212; TensorKrowch 1.0.1 documentation</title>
<title>tensorkrowch.components &#8212; TensorKrowch 1.1.0 documentation</title>

<!-- Loaded before other Sphinx assets -->
<link href="../../_static/styles/theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
Expand Down Expand Up @@ -1103,6 +1103,11 @@ <h1>Source code for tensorkrowch.components</h1><div class="highlight"><pre>
<span class="n">List</span><span class="p">[</span><span class="s1">&#39;AbstractNode&#39;</span><span class="p">]]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns the neighbours of the node, the nodes to which it is connected.</span>
<span class="sd"> </span>
<span class="sd"> If ``self`` is a ``resultant`` node, this will return the neighbours of</span>
<span class="sd"> the ``leaf`` nodes from which ``self`` inherits the edges. Therefore,</span>
<span class="sd"> one cannot check if two ``resultant`` nodes are connected by looking</span>
<span class="sd"> into their neighbours lists. To do that, use :meth:`is_connected_to`.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
Expand Down Expand Up @@ -2142,7 +2147,8 @@ <h1>Source code for tensorkrowch.components</h1><div class="highlight"><pre>

<div class="viewcode-block" id="AbstractNode.norm"><a class="viewcode-back" href="../../components.html#tensorkrowch.AbstractNode.norm">[docs]</a> <span class="k">def</span> <span class="nf">norm</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
<span class="n">p</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span>
<span class="n">axis</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">Ax</span><span class="p">,</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">Ax</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tensor</span><span class="p">:</span>
<span class="n">axis</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">Ax</span><span class="p">,</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">Ax</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">keepdim</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tensor</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns the norm of all elements in the node&#39;s tensor. If an ``axis`` is</span>
<span class="sd"> specified, the norm is over that axis. If ``axis`` is a sequence of axes,</span>
Expand All @@ -2159,6 +2165,9 @@ <h1>Source code for tensorkrowch.components</h1><div class="highlight"><pre>
<span class="sd"> The order of the norm.</span>
<span class="sd"> axis : int, str, Axis or list[int, str or Axis], optional</span>
<span class="sd"> Axis or sequence of axes over which to reduce.</span>
<span class="sd"> keepdim : bool</span>
<span class="sd"> Boolean indicating whether the output tensor have dimensions</span>
<span class="sd"> retained or not.</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
Expand All @@ -2184,7 +2193,7 @@ <h1>Source code for tensorkrowch.components</h1><div class="highlight"><pre>
<span class="n">axis_num</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_axis_num</span><span class="p">(</span><span class="n">ax</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">axis_num</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_axis_num</span><span class="p">(</span><span class="n">axis</span><span class="p">))</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">tensor</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">p</span><span class="o">=</span><span class="n">p</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="n">axis_num</span><span class="p">)</span></div>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">tensor</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">p</span><span class="o">=</span><span class="n">p</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="n">axis_num</span><span class="p">,</span> <span class="n">keepdim</span><span class="o">=</span><span class="n">keepdim</span><span class="p">)</span></div>

<div class="viewcode-block" id="AbstractNode.numel"><a class="viewcode-back" href="../../components.html#tensorkrowch.AbstractNode.numel">[docs]</a> <span class="k">def</span> <span class="nf">numel</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tensor</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
Expand Down
Loading

0 comments on commit 610c878

Please sign in to comment.