()
Run AND and XOR logic functions
Run AND and XOR logic functions
Run AND and XOR logic functions
def logic():
	import pcn
	""" Run AND and XOR logic functions"""

	a = np.array([[0,0,0],[0,1,0],[1,0,0],[1,1,1]])
	b = np.array([[0,0,0],[0,1,1],[1,0,1],[1,1,0]])

	p = pcn.pcn(a[:,0:2],a[:,2:])
	p.pcntrain(a[:,0:2],a[:,2:],0.25,10)
	p.confmat(a[:,0:2],a[:,2:])

	q = pcn.pcn(b[:,0:2],b[:,2:])
	q.pcntrain(b[:,0:2],b[:,2:],0.25,10)
	q.confmat(b[:,0:2],b[:,2:])
def logic ( ) : import pcn a = np . array ( [ [ 0 , 0 , 0 ] , [ 0 , 1 , 0 ] , [ 1 , 0 , 0 ] , [ 1 , 1 , 1 ] ] ) b = np . array ( [ [ 0 , 0 , 0 ] , [ 0 , 1 , 1 ] , [ 1 , 0 , 1 ] , [ 1 , 1 , 0 ] ] ) p = pcn . pcn ( a [ : , 0 : 2 ] , a [ : , 2 : ] ) p . pcntrain ( a [ : , 0 : 2 ] , a [ : , 2 : ] , 0.25 , 10 ) p . confmat ( a [ : , 0 : 2 ] , a [ : , 2 : ] ) q = pcn . pcn ( b [ : , 0 : 2 ] , b [ : , 2 : ] ) q . pcntrain ( b [ : , 0 : 2 ] , b [ : , 2 : ] , 0.25 , 10 ) q . confmat ( b [ : , 0 : 2 ] , b [ : , 2 : ] )