GENERIC: highly efficient learning engine on edge using hyperdimensional computing