design four classes: perceptron, model, data, decoder