Unsupervised learning with global objective functions