Bidirectional reinforcement learning neural network for constrained molecular design