Yep, pretty much agree with all the replies here so far. If you've learned a piece my memory, you're going to execute it not thinking of it as a musical task, but as a physical task -- just playing the right keys, frets, etc. at the right time. When improvising, it's much more a musical-mental exercise, so you would need to think of the notes you are playing. However, on instruments like the guitar, you may be able to forget about notes if you've certain licks or phrases in your arsenal that have you memorizing the patters or shapes rather than actual notes per se.