Learning, Computing, and Trustworthiness in Intelligent IoT Environments: Performance-Energy Tradeoffs