How to train a model to generate image embeddings from scratch