Retrieval capabilities of hierarchical networks: From dyson to hopfield