import numpy as np

from NeuralNetwork import NeuralNetwork

nn = NeuralNetwork(2, 2, 1)

inputs = np.array([[0, 0],[0, 1],[1, 0],[1, 1]])
targets = np.array([[0], [1], [1], [0]])

print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))
print("---------------------------------")

for _ in range(10000):
  nn.train(inputs, targets)

print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))

1481dcd3c4a9d050672816d5fe9a0acf5c2efa43
<mask token>

<mask token>
print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))
print('---------------------------------')
for _ in range(10000):
    nn.train(inputs, targets)
print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))

<mask token>
nn = NeuralNetwork(2, 2, 1)
inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
targets = np.array([[0], [1], [1], [0]])
print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))
print('---------------------------------')
for _ in range(10000):
    nn.train(inputs, targets)
print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))

import numpy as np
from NeuralNetwork import NeuralNetwork
nn = NeuralNetwork(2, 2, 1)
inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
targets = np.array([[0], [1], [1], [0]])
print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))
print('---------------------------------')
for _ in range(10000):
    nn.train(inputs, targets)
print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))

import numpy as np

from NeuralNetwork import NeuralNetwork

nn = NeuralNetwork(2, 2, 1)

inputs = np.array([[0, 0],[0, 1],[1, 0],[1, 1]])
targets = np.array([[0], [1], [1], [0]])

print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))
print("---------------------------------")

for _ in range(10000):
  nn.train(inputs, targets)

print(nn.feedforward(np.array([[0, 0]])))
print(nn.feedforward(np.array([[1, 1]])))
print(nn.feedforward(np.array([[0, 1]])))
print(nn.feedforward(np.array([[1, 0]])))
