Ternary Neural Networks Based on on/off Memristors : set-Up and Training