Calculating the capacity (with or without feedback) of channels with memory\nand continuous alphabets is a challenging task. It requires optimizing the\ndirected information (DI) rate over all channel input distributions. The\nobjective is a multi-letter expression, whose analytic solution is only known\nfor a few specific cases. When no analytic solution is present or the channel\nmodel is unknown, there is no unified framework for calculating or even\napproximating capacity. This work proposes a novel capacity estimation\nalgorithm that treats the channel as a `black-box', both when feedback is or is\nnot present. The algorithm has two main ingredients: (i) a neural distribution\ntransformer (NDT) model that shapes a noise variable into the channel input\ndistribution, which we are able to sample, and (ii) the DI neural estimator\n(DINE) that estimates the communication rate of the current NDT model. These\nmodels are trained by an alternating maximization procedure to both estimate\nthe channel capacity and obtain an NDT for the optimal input distribution. The\nmethod is demonstrated on the moving average additive Gaussian noise channel,\nwhere it is shown that both the capacity and feedback capacity are estimated\nwithout knowledge of the channel transition kernel. The proposed estimation\nframework opens the door to a myriad of capacity approximation results for\ncontinuous alphabet channels that were inaccessible until now.\n