You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from blocks.main_loop import MainLoop
from blocks.bricks import MLP, Tanh, Softmax
from blocks.model import Model
mlp = MLP([Tanh(), None], [784, 10, 10])
x = tensor.matrix('features')
y = tensor.lmatrix('targets')
cost = Softmax().categorical_cross_entropy(
... y.flatten(), mlp.apply(tensor.flatten(x, outdim=2)))
main_loop = MainLoop(None, None, model=Model(cost))
Let's see how the main loop is dumped by :func:dump
from blocks.serialization import dump, load
import tarfile
with open(' main_loop.tar', 'wb') as dst:
... dump(main_loop, dst)
tarball = tarfile.open('main_loop.tar', 'r')
tarball # doctest: +ELLIPSIS
<tarfile.TarFile object at ...>
tarball.getnames()
['_pkl']
tarball.close()
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: