One great way to keep motivated is to keep a training journal. Every time you train, make a dated entry including sections about what you did for that practice session, what your short-term, mid-term and long-term goals are, how much progress was made towards those goals, things that are going well and things that need more practice, feel will make a good addition to your entries. When you discover something during practice, make sure you include it in your journal.
Clear your mind of outside distractions before you train. Do some deep breathing or meditation beforehand, and get your mind thinking about the martial arts with a ritual of some sort, possibly your warm-up. Don't allow anyone or anything to distract you. If you are interrupted, clear your mind again and do at least part of your just-before- practice ritual before returning to your practising.
Visualization can be a huge asset to the martial artist. Use your imagination as well as you can to think of a stressful situation and work out that stress in your practicing; visualise your punches and kicks being thrown with that stressful energy (much like ki [or qi or chi] energy, or possibly the same {I don't know, I'm not an expert on ki energy}) and you will feel energized about your training, not like your forcing yourself to do it. You can use real situations and people that stress you out, or entirely imagined ones.
"Set goals" is almost a platitude when it comes to talking about motivation and achievement in anything; it's almost a waste of space to talk about it, but it really works! There are a few ways to help you to achieve these goals that might not be so apparent, though. Set a deadline for meeting the goal. Make it possible, but challenging. Let people know what you are trying to accomplish, and that you are trying to do it by a certain time. This works really well for people who like some competition; it makes you want to prove to other people that you can achieve your goals and it makes the goal seem more real, and therefor more attainable. Also, you can dangle a figurative carrot in front of your nose by promising some sort of reward to yourself when you reach the goal.