Trained Algorithms for Mode Decomposition in Ducts