Skip to content

Commit 55b99a9

Browse files
ferrinetaku-y
authored andcommitted
some fixes in docstring
1 parent e8f54d2 commit 55b99a9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pymc3/data.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,21 @@ class Minibatch(tt.TensorVariable):
183183
>>> minibatch = shared[ridx]
184184
185185
That's done. Next you can use this minibatch somewhere else.
186-
You can see that in implementation minibatch does not require
187-
fixed shape for shared variable. Feel free to use that if needed.
186+
You can see that implementation does not require fixed shape
187+
for shared variable. Feel free to use that if needed.
188188
189-
So if you'll need some replacements in the graph, e.g. change it to testdata
189+
Suppose you need some replacements in the graph, e.g. change minibatch to testdata
190+
>>> node = x ** 2 # arbitrary expressions on minibatch `x`
190191
>>> testdata = pm.floatX(np.random.laplace(size=(1000, 10)))
191192
192-
You can change minibatch with static data you can create a dict with replacements
193+
Then you should create a dict with replacements
193194
>>> replacements = {x: testdata}
194-
>>> node = x ** 2 # arbitrary expressions
195195
>>> rnode = theano.clone(node, replacements)
196196
>>> assert (testdata ** 2 == rnode.eval()).all()
197197
198-
To replace minibatch with it's shared variable
199-
instead of static :class:`ndarray` you should do
198+
To replace minibatch with it's shared variable you should do
199+
the same things. Minibatch variable is accessible as an attribute
200+
as well as shared, associated with minibatch
200201
>>> replacements = {x.minibatch: x.shared}
201202
>>> rnode = theano.clone(node, replacements)
202203

0 commit comments

Comments
 (0)