Skip to content

Commit

Permalink
Merge pull request #147 from DonnaVakalis/fix-typos
Browse files Browse the repository at this point in the history
Fix typos in intro tutorial docs
  • Loading branch information
drgona authored Apr 23, 2024
2 parents 77aa81f + b0fc10d commit eb54269
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 5 additions & 3 deletions examples/tutorials/part_2_variable.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"Variables which will instantiate and perform the sequence of mathematical operations. PyTorch callables\n",
"called with variables as inputs return variables. Variable supports binary infix operators (variable * variable, variable * numeric): +, -, *, @, **, <, <=, >, >=, ==, ^\n",
"\n",
"There are several ways how to instantiate variable:"
"There are several ways to instantiate a variable:"
]
},
{
Expand All @@ -99,7 +99,7 @@
],
"source": [
"# 1, named Variable without trainable tensor value\n",
"# intented to be used as a symbolic handler for input data or model outputs\n",
"# intended to be used as a symbolic handler for input data or model outputs\n",
"x1 = variable('x')\n",
"# evaluate forward pass of the variable with dictionary input data\n",
"print(x1({'x': 5.00}))"
Expand Down Expand Up @@ -335,7 +335,7 @@
],
"source": [
"# 5, composite Variable more complex example\n",
"a, b = variable('a'), variable('a')\n",
"a, b = variable('a'), variable('b')\n",
"x6 = a/3. - 1.5*b**2 + 5\n",
"# visualize computational graph of Variable\n",
"x6.show()\n",
Expand Down Expand Up @@ -490,6 +490,7 @@
"# 8, create new variables via slicing on existing variables\n",
"# select column 0\n",
"x10_column0 = x10[:, 0]\n",
"# note: the following still works because in case of a size mismatch the y tensor is automatically broadcast to the shape of the x tensor\n",
"print(x10_column0({'x': torch.randn(2, 2), 'y': torch.randn(2, 1)}))\n",
"x10_column0.show()"
]
Expand Down Expand Up @@ -521,6 +522,7 @@
"source": [
"# select column 1\n",
"x10_column1 = x10[:, 1]\n",
"# as above, the y tensor is broadcast to the shape of the x tensor\n",
"print(x10_column1({'x': torch.randn(2, 2), 'y': torch.randn(2, 1)}))\n",
"x10_column1.show()"
]
Expand Down
8 changes: 5 additions & 3 deletions examples/tutorials/part_2_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
Variables which will instantiate and perform the sequence of mathematical operations. PyTorch callables
called with variables as inputs return variables. Variable supports binary infix operators (variable * variable, variable * numeric): +, -, *, @, **, <, <=, >, >=, ==, ^
There are several ways how to instantiate variable:
There are several ways to instantiate a variable:
"""

# 1, named Variable without trainable tensor value
# intented to be used as a symbolic handler for input data or model outputs
# intended to be used as a symbolic handler for input data or model outputs
x1 = variable('x')
# evaluate forward pass of the variable with dictionary input data
print(x1({'x': 5.00}))
Expand Down Expand Up @@ -78,7 +78,7 @@
# visualize computational graph of Variable
x6.show()
# more complex example
a, b = variable('a'), variable('a')
a, b = variable('a'), variable('b')
x6 = a/3. - 1.5*b**2 + 5
x6.show()
# evaluate forward pass of the variable with dictionary input data
Expand Down Expand Up @@ -110,10 +110,12 @@
# 8, create new variables via slicing on existing variables
# select column 0
x10_column0 = x10[:, 0]
# note: the following still works because in case of a size mismatch the y tensor is automatically broadcast to the shape of the x tensor
print(x10_column0({'x': torch.randn(2, 2), 'y': torch.randn(2, 1)}))
x10_column0.show()
# select column 1
x10_column1 = x10[:, 1]
# as above, the y tensor is broadcast to the shape of the x tensor
print(x10_column1({'x': torch.randn(2, 2), 'y': torch.randn(2, 1)}))
x10_column1.show()

Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/part_3_node.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
}
],
"source": [
"# 2, instantiate recurrent neural net without bias, SVD linear map, and BLI activation\n",
"# 2, instantiate recurrent neural net without bias, SVD linear map, and BLU activation\n",
"block_2 = blocks.RNN(insize=2, outsize=2,\n",
" bias=False,\n",
" linear_map=slim.linear.SVDLinear,\n",
Expand Down Expand Up @@ -346,7 +346,7 @@
"# 1, create acyclic symbolic graph\n",
"# list of nodes to construct the graph\n",
"nodes = [node_1, node_2, node_3]\n",
"# 10 steps rollout\n",
"# n steps rollout\n",
"nsteps = 3\n",
"# connecting nodes via System class\n",
"system_1 = System(nodes, nsteps=nsteps)\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/part_3_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def fun_2(x1, x2):
print(node_4(data).keys())
print(node_4(data)['y3'].shape)

# 2, instantiate recurrent neural net without bias, SVD linear map, and BLI activation
# 2, instantiate recurrent neural net without bias, SVD linear map, and BLU activation
block_2 = blocks.RNN(insize=2, outsize=2,
bias=False,
linear_map=slim.linear.SVDLinear,
Expand Down Expand Up @@ -110,7 +110,7 @@ def fun_2(x1, x2):
# 1, create acyclic symbolic graph
# list of nodes to construct the graph
nodes = [node_1, node_2, node_3]
# 10 steps rollout
# n steps rollout
nsteps = 3
# connecting nodes via System class
system_1 = System(nodes, nsteps=nsteps)
Expand Down

0 comments on commit eb54269

Please sign in to comment.