Backpropagation I think. Please fix if bugged or broken or unscalable or proof of concept is just luck.