Pulse shaping is a powerful tool for mitigating implosion instabilities in direct-drive inertial confinement fusion (ICF). However, the high-dimensional and nonlinear nature of implosions makes the pulse optimization quite challenging. In this research, we develop a machine-learning pulse shape designer to achieve high compression density and stable implosion. The facility-specific laser imprint pattern is considered in the optimization, which makes the pulse design more relevant. The designer is applied to the novel double-cone ignition scheme, and simulation shows that the optimized pulse increases the areal density expectation by 16% in one dimension, and the clean-fuel thickness by a factor of four in two dimensions. This pulse shape designer could be a useful tool for direct-drive ICF instability control.