Message passing algorithm for non linear nodes and data compression