Competitive Anti-Hebbian Learning of Invariants