Agency and assemblage in pattern generalisation: a materialist approach to learning