Uncertainty in discriminating between different received coherent signals is integral to the operation of many free-space optical communications protocols, and is often difficult when the receiver measures a weak signal. Here we design an optical communications scheme that uses balanced homodyne detection in combination with an unsupervised generative machine learning and convolutional neural network (CNN) system, and demonstrate its efficacy in a realistic simulated coherent quadrature phase shift keyed (QPSK) communications system. Additionally, we program the neural network system at the transmitter such that it autonomously learns to correct for the noise associated with a weak QPSK signal, which is shared with the network state of the receiver prior to the implementation of the communications. We find that the scheme significantly reduces the overall error probability of the communications system, achieving the classical optimal limit. This communications design is straightforward to build, implement, and scale. We anticipate that these results will allow for a significant enhancement of current classical and quantum coherent optical communications technologies.