3.22. Making MoviesΒΆ
In [1]:
import conx as cx
Using Theano backend.
Conx, version 3.6.0
In [2]:
net = cx.Network("Same", 2, 5, 1, activation="sigmoid")
net.compile(error="mse", optimizer="adam")
In [7]:
net.picture()
Out[7]:
In [3]:
net.dataset.load([
[[0, 0], [1]],
[[0, 1], [0]],
[[1, 0], [0]],
[[1, 1], [1]],
])
In [4]:
net.plot_activation_map(format="image")
Out[4]:
In [5]:
if net.saved():
net.load()
net.plot_results()
else:
net.train(2000, accuracy=1.0, tolerance=.2, record=True, report_rate=25, plot=True)
net.save()
========================================================
| Training | Training
Epochs | Error | Accuracy
------ | --------- | ---------
# 2000 | 0.08333 | 0.00000
In [6]:
net.movie(lambda net, epoch: net.plot_activation_map(title="Epoch %s" % epoch,
format="image"),
step=200, duration=500)
Out[6]: