The aim is to arrive at the final clean speed as the flap finally retracts. The requirement is not worse than level flight but how to do it best for a given aircraft will be prescribed in the AFM.
While deferring to Centaurus (who has about a gazillion times more 737 experience than I), I seem to recall that the idea with the 737 was a shallow climb to avoid over running the clean speed during the retraction sequence.