test function functions for multiple perceptrons and writes to file