Approximate memory for energy-efficient machine learning