Multi-layer perceptrons with discrete weights