Inefficient but easy to understand neural network library. Cobweb has been made from scratch. It doesn't use any external library. (not even numpy 😱) |
---|
from cobweb import Cobweb
# inputs, outputs
nn = Cobweb(3, 4)
nn.add_layer(8)
nn.add_layer(16, activation="tanh") #default = sigmoid
# Fully connected layers:
# 3 -> 8 -> 16 -> 4
# inputs, label
nn.train([0.6, 0.88, 0.36], [1, 0, 0, 0])
guess = nn.predict([0.6, 0.88, 0.36])
print(guess)
# Save
nn.save("filename.json")
# Load
loaded_nn = Cobweb.load("filename.json")
You can checkout cobweb/matris.py
for the handmade matrix math class.