Non-Archimedean and tropical theta functions