Learning spatio-temporal behavioural sequences