Implementing invariances in high order neural nets