learning algorithms for p-adic networks