Modified training routine; add testing routine; support negative samples