Training and testing scripts