3.24. Making MoviesΒΆ

In [1]:
from conx import *
Using Theano backend.
conx, version 3.5.4
In [2]:
net = Network("Same", 2, 5, 1, activation="sigmoid")
net.compile(error="mse", optimizer="adam")
In [3]:
net.dataset.load([
    [[0, 0], [1]],
    [[0, 1], [0]],
    [[1, 0], [0]],
    [[1, 1], [1]],
])
In [4]:
net.plot_activation_map(interactive=False, format="pil")
Out[4]:
_images/MakingMovies_4_0.png
In [5]:
if net.saved():
    net.load()
    net.plot_loss_acc()
else:
    net.train(2000, accuracy=1.0, tolerance=.2, record=True, report_rate=25, plot=True)
    net.save()
_images/MakingMovies_5_0.png
In [6]:
net.movie(lambda net, epoch: net.plot_activation_map(title="Epoch %s" % epoch,
                                                     interactive=False, format="pil"),
          step=200, duration=500)
Out[6]: