Machine learning for power control in D2D communication based on cellular channel gains