XOR Multiple Inputs/Targets

Testing...

In [1]:
from conx import Network, Layer, SGD
conx, version 3.2.3
Using Theano backend.
In [2]:
net = Network("XOR Network", 2, 4, 1, activation="sigmoid")
In [3]:
net.compile(loss='mean_squared_error',
            optimizer=SGD(lr=0.3, momentum=0.9))
In [4]:
dataset = [
    ([0, 0], [0]),
    ([0, 1], [1]),
    ([1, 0], [1]),
    ([1, 1], [0])
]
net["output"].minmax = (0, 1)
In [5]:
net.dataset.load(dataset)
net.dataset.summary()
Input Summary:
   count  : 4 (4 for training, 0 for testing)
   shape  : (2,)
   range  : (0.0, 1.0)
Target Summary:
   count  : 4 (4 for training, 0 for testing)
   shape  : (1,)
   range  : (0.0, 1.0)
In [6]:
net.dataset.targets[0]
Out[6]:
[0.0]
In [7]:
net.dataset.inputs.shape()
Out[7]:
(2,)
In [8]:
net.dashboard()
In [9]:
net.propagate([0, 0])
Out[9]:
[0.7129254937171936]
In [10]:
net.train(epochs=2000, accuracy=1.0, report_rate=25)
Training...
Epoch #    1 | train loss 0.28791 | train accuracy 0.50000
Epoch #   26 | train loss 0.25325 | train accuracy 0.25000
Epoch #   51 | train loss 0.25000 | train accuracy 0.50000
Epoch #   76 | train loss 0.24939 | train accuracy 0.50000
Epoch #  101 | train loss 0.24891 | train accuracy 0.50000
Epoch #  126 | train loss 0.24831 | train accuracy 0.50000
Epoch #  151 | train loss 0.24734 | train accuracy 0.75000
Epoch #  176 | train loss 0.24556 | train accuracy 0.75000
Epoch #  201 | train loss 0.24202 | train accuracy 0.75000
Epoch #  226 | train loss 0.23466 | train accuracy 0.75000
Epoch #  251 | train loss 0.21909 | train accuracy 0.75000
Epoch #  276 | train loss 0.18461 | train accuracy 0.75000
========================================================================
Epoch #  284 | train loss 0.16644 | train accuracy 1.00000
In [11]:
net.test()
Testing entire dataset...
# | inputs | targets | outputs | result
---------------------------------------
0 | [0.00,0.00] | [0.00] | [0.41] | correct
1 | [0.00,1.00] | [1.00] | [0.67] | correct
2 | [1.00,0.00] | [1.00] | [0.51] | correct
3 | [1.00,1.00] | [0.00] | [0.37] | correct
Total count: 4
      correct: 4
      incorrect: 0
Total percentage correct: 1.0
In [12]:
net.propagate_to("input", [0, 1])
Out[12]:
[0.0, 1.0]
In [13]:
net.propagate([0.5, 0.5])
Out[13]:
[0.3880871832370758]
In [14]:
net.propagate_to("hidden", [1, 0])
Out[14]:
[0.07694508880376816,
 0.9931868314743042,
 0.22208942472934723,
 0.6617006659507751]
In [15]:
net.propagate_to("output", [1, 1])
Out[15]:
[0.36646634340286255]
In [16]:
net.propagate_to("input", [0.25, 0.25])
Out[16]:
[0.25, 0.25]
In [17]:
net.propagate_from("input", [1.0, 1.0])
Out[17]:
[0.27918833]
In [18]:
net.propagate_from("hidden", [1.0, 0.0, 1.0, -1.0])
Out[18]:
[0.82524538]
In [19]:
net.test()
Testing entire dataset...
# | inputs | targets | outputs | result
---------------------------------------
0 | [0.00,0.00] | [0.00] | [0.41] | correct
1 | [0.00,1.00] | [1.00] | [0.67] | correct
2 | [1.00,0.00] | [1.00] | [0.51] | correct
3 | [1.00,1.00] | [0.00] | [0.37] | correct
Total count: 4
      correct: 4
      incorrect: 0
Total percentage correct: 1.0
In [20]:
from conx import Network, Layer, SGD
In [21]:
net = Network("XOR2 Network")
net.add(Layer("input1", 1))
net.add(Layer("input2", 1))
net.add(Layer("hidden1", 10, activation="sigmoid"))
net.add(Layer("hidden2", 10, activation="sigmoid"))
net.add(Layer("shared-hidden", 5, activation="sigmoid"))
net.add(Layer("output1", 1, activation="sigmoid", minmax=(-1,1)))
net.add(Layer("output2", 1, activation="sigmoid", minmax=(-1,1)))
In [22]:
net
Out[22]:
<Network name='XOR2 Network' (uncompiled)>
In [23]:
net.connect("input1", "hidden1")
net.connect("input2", "hidden2")
net.connect("hidden1", "shared-hidden")
net.connect("hidden2", "shared-hidden")
net.connect("shared-hidden", "output1")
net.connect("shared-hidden", "output2")
In [24]:
net.layers[2].incoming_connections
Out[24]:
[<Layer name='input1', shape=(1,), act='None'>]
In [25]:
net.compile(loss='mean_squared_error',
            optimizer=SGD(lr=0.3, momentum=0.9))
In [26]:
net.config["hspace"] = 200
net.dashboard()
In [27]:
net.propagate_to_features("hidden1", [[[1], [1]]])
In [28]:
net.propagate([[1], [1]])
Out[28]:
[[0.36669450998306274], [0.7667419910430908]]
In [29]:
dataset = [
    ([[0],[0]], [[0],[0]]),
    ([[0],[1]], [[1],[1]]),
    ([[1],[0]], [[1],[1]]),
    ([[1],[1]], [[0],[0]])
]
In [30]:
net.dataset.load(dataset)
In [31]:
net.get_weights("hidden2")
Out[31]:
[[[-0.2311440408229828,
   -0.11553583294153214,
   -0.06258577108383179,
   0.14661431312561035,
   0.6824564933776855,
   -0.0180278979241848,
   -0.43046876788139343,
   0.532232940196991,
   0.27135470509529114,
   -0.132258340716362]],
 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]
In [35]:
net.model.layers[-1].output
Out[35]:
sigmoid.0
In [36]:
import numpy as np
In [37]:
net.model.predict([np.array([[1]]), np.array([[1]])])
Out[37]:
[array([[ 0.63918394]], dtype=float32), array([[ 0.47949073]], dtype=float32)]
In [38]:
net.propagate([[1], [1]])
Out[38]:
[[0.6391839385032654], [0.479490727186203]]
In [39]:
for i in range(20):
    (epoch_count, loss, acc, val_acc) = net.train(epochs=100, verbose=0)
    for index in range(4):
        net.propagate(dataset[index][0])
In [40]:
net.reset()
In [32]:
net.train(epochs=2000, accuracy=1.0, report_rate=25)
Training...
Epoch #    1 | train loss 0.58649 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #   26 | train loss 0.50276 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #   51 | train loss 0.50008 | output1 accuracy 0.75000 | output2 accuracy 0.50000
Epoch #   76 | train loss 0.50002 | output1 accuracy 0.75000 | output2 accuracy 0.50000
Epoch #  101 | train loss 0.50000 | output1 accuracy 0.25000 | output2 accuracy 0.75000
Epoch #  126 | train loss 0.49999 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  151 | train loss 0.49999 | output1 accuracy 0.75000 | output2 accuracy 0.50000
Epoch #  176 | train loss 0.49998 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  201 | train loss 0.49998 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  226 | train loss 0.49998 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  251 | train loss 0.49997 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  276 | train loss 0.49997 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  301 | train loss 0.49997 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  326 | train loss 0.49996 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  351 | train loss 0.49996 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  376 | train loss 0.49995 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  401 | train loss 0.49995 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  426 | train loss 0.49994 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  451 | train loss 0.49993 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  476 | train loss 0.49993 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  501 | train loss 0.49992 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  526 | train loss 0.49991 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  551 | train loss 0.49990 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  576 | train loss 0.49989 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  601 | train loss 0.49988 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  626 | train loss 0.49986 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  651 | train loss 0.49985 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  676 | train loss 0.49983 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  701 | train loss 0.49981 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  726 | train loss 0.49978 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  751 | train loss 0.49975 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  776 | train loss 0.49972 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  801 | train loss 0.49968 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  826 | train loss 0.49963 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  851 | train loss 0.49957 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  876 | train loss 0.49949 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  901 | train loss 0.49940 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  926 | train loss 0.49928 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  951 | train loss 0.49912 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch #  976 | train loss 0.49891 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch # 1001 | train loss 0.49862 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch # 1026 | train loss 0.49820 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch # 1051 | train loss 0.49758 | output1 accuracy 0.50000 | output2 accuracy 0.50000
Epoch # 1076 | train loss 0.49658 | output1 accuracy 0.75000 | output2 accuracy 0.50000
Epoch # 1101 | train loss 0.49486 | output1 accuracy 0.75000 | output2 accuracy 0.75000
Epoch # 1126 | train loss 0.49160 | output1 accuracy 0.75000 | output2 accuracy 0.75000
Epoch # 1151 | train loss 0.48456 | output1 accuracy 0.75000 | output2 accuracy 0.75000
Epoch # 1176 | train loss 0.46737 | output1 accuracy 0.75000 | output2 accuracy 0.75000
Epoch # 1201 | train loss 0.42680 | output1 accuracy 0.75000 | output2 accuracy 0.75000
Epoch # 1226 | train loss 0.36002 | output1 accuracy 0.75000 | output2 accuracy 0.75000
Epoch # 1251 | train loss 0.23500 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1276 | train loss 0.06225 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1301 | train loss 0.02145 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1326 | train loss 0.01268 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1351 | train loss 0.00915 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1376 | train loss 0.00718 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1401 | train loss 0.00590 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1426 | train loss 0.00500 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1451 | train loss 0.00434 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1476 | train loss 0.00383 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1501 | train loss 0.00342 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1526 | train loss 0.00309 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1551 | train loss 0.00281 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1576 | train loss 0.00258 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1601 | train loss 0.00239 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1626 | train loss 0.00222 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1651 | train loss 0.00207 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1676 | train loss 0.00194 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1701 | train loss 0.00183 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1726 | train loss 0.00172 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1751 | train loss 0.00163 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1776 | train loss 0.00155 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1801 | train loss 0.00147 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1826 | train loss 0.00141 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1851 | train loss 0.00134 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1876 | train loss 0.00129 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1901 | train loss 0.00123 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1926 | train loss 0.00119 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1951 | train loss 0.00114 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 1976 | train loss 0.00110 | output1 accuracy 1.00000 | output2 accuracy 1.00000
========================================================================
Epoch # 2000 | train loss 0.00106 | output1 accuracy 1.00000 | output2 accuracy 1.00000
In [33]:
net.propagate_from("input1", [0.0])
Out[33]:
[[0.5], [0.5]]
In [34]:
net.propagate_from("shared-hidden", [0.0] * 5)
Out[34]:
[[0.5], [0.5]]
In [35]:
net.propagate_to("hidden1", [[1], [1]])
Out[35]:
[0.3751141130924225,
 0.889658510684967,
 0.89875328540802,
 0.6092547178268433,
 0.24401943385601044,
 0.16180700063705444,
 0.7947645783424377,
 0.15046218037605286,
 0.6669700145721436,
 0.09412296116352081]
In [36]:
net.test()
Testing entire dataset...
# | inputs | targets | outputs | result
---------------------------------------
0 | [[0.00],[0.00]] | [[0.00],[0.00]] | [[0.02],[0.02]] | correct
1 | [[0.00],[1.00]] | [[1.00],[1.00]] | [[0.98],[0.98]] | correct
2 | [[1.00],[0.00]] | [[1.00],[1.00]] | [[0.98],[0.98]] | correct
3 | [[1.00],[1.00]] | [[0.00],[0.00]] | [[0.02],[0.02]] | correct
Total count: 4
      correct: 4
      incorrect: 0
Total percentage correct: 1.0
In [37]:
net.dataset.slice(2)
In [38]:
net.train(epochs=2000, accuracy=1.0, report_rate=25)
Training...
Epoch # 2001 | train loss 0.00103 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2026 | train loss 0.00094 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2051 | train loss 0.00085 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2076 | train loss 0.00078 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2101 | train loss 0.00072 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2126 | train loss 0.00067 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2151 | train loss 0.00063 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2176 | train loss 0.00060 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2201 | train loss 0.00057 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2226 | train loss 0.00054 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2251 | train loss 0.00052 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2276 | train loss 0.00049 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2301 | train loss 0.00047 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2326 | train loss 0.00046 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2351 | train loss 0.00044 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2376 | train loss 0.00042 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2401 | train loss 0.00041 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2426 | train loss 0.00039 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2451 | train loss 0.00038 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2476 | train loss 0.00037 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2501 | train loss 0.00036 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2526 | train loss 0.00035 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2551 | train loss 0.00034 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2576 | train loss 0.00033 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2601 | train loss 0.00032 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2626 | train loss 0.00031 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2651 | train loss 0.00030 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2676 | train loss 0.00030 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2701 | train loss 0.00029 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2726 | train loss 0.00028 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2751 | train loss 0.00028 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2776 | train loss 0.00027 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2801 | train loss 0.00026 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2826 | train loss 0.00026 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2851 | train loss 0.00025 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2876 | train loss 0.00025 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2901 | train loss 0.00024 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2926 | train loss 0.00024 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2951 | train loss 0.00023 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 2976 | train loss 0.00023 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3001 | train loss 0.00023 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3026 | train loss 0.00022 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3051 | train loss 0.00022 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3076 | train loss 0.00021 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3101 | train loss 0.00021 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3126 | train loss 0.00021 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3151 | train loss 0.00020 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3176 | train loss 0.00020 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3201 | train loss 0.00020 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3226 | train loss 0.00019 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3251 | train loss 0.00019 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3276 | train loss 0.00019 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3301 | train loss 0.00019 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3326 | train loss 0.00018 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3351 | train loss 0.00018 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3376 | train loss 0.00018 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3401 | train loss 0.00017 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3426 | train loss 0.00017 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3451 | train loss 0.00017 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3476 | train loss 0.00017 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3501 | train loss 0.00017 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3526 | train loss 0.00016 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3551 | train loss 0.00016 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3576 | train loss 0.00016 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3601 | train loss 0.00016 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3626 | train loss 0.00016 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3651 | train loss 0.00015 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3676 | train loss 0.00015 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3701 | train loss 0.00015 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3726 | train loss 0.00015 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3751 | train loss 0.00015 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3776 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3801 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3826 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3851 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3876 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3901 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3926 | train loss 0.00014 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3951 | train loss 0.00013 | output1 accuracy 1.00000 | output2 accuracy 1.00000
Epoch # 3976 | train loss 0.00013 | output1 accuracy 1.00000 | output2 accuracy 1.00000
========================================================================
Epoch # 4000 | train loss 0.00013 | output1 accuracy 1.00000 | output2 accuracy 1.00000

Conx model is a Keras Model

In [39]:
from keras.utils.vis_utils import model_to_dot
from IPython.display import HTML
In [40]:
dot = model_to_dot(net.model, rankdir="BT")
In [41]:
HTML(dot.create_svg().decode())
Out[41]:
G 139647785814112 input1: InputLayer 139646339722656 hidden1: Dense 139647785814112->139646339722656 139646432729352 input2: InputLayer 139646432729744 hidden2: Dense 139646432729352->139646432729744 139646337326888 concatenate_1: Concatenate 139646339722656->139646337326888 139646432729744->139646337326888 139646339720304 shared-hidden: Dense 139646337326888->139646339720304 139646339868096 output1: Dense 139646339720304->139646339868096 139646337327000 output2: Dense 139646339720304->139646337327000