![]() |
Jupyter at Bryn Mawr College |
|
|
Public notebooks: /services/public/dblank / Experiments |
! pip install conx -U
from conx import Network
net = Network(2, 2, 1)
inputs = [[0, 0],
[0, 1],
[1, 0],
[1, 1]]
def xor(inputs):
a = inputs[0]
b = inputs[1]
return [int((a or b) and not(a and b))]
net.set_inputs(inputs)
net.set_target_function(xor)
net.test()
%%time
net.train()
net.test()