Skip to content

PyTorch Implementation of "Unsupervised Visual Representation Learning by Context Prediction"

License

Notifications You must be signed in to change notification settings

sanjeevg15/context-prediction-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4d76943 · Jun 26, 2024

History

5 Commits
Jun 26, 2024
Jun 26, 2024
Jun 26, 2024
Jun 26, 2024
Jun 26, 2024

Repository files navigation

Context Prediction Pytorch

PyTorch Implementation of Unsupervised Visual Representation Learning by Context Prediction by Carl Doersch, et al.

This repository allows you to train any "feature extractor" on any image dataset in a self-supervised fashion using the Context Prediction methodology described in the above seminal research paper.

A feature extractor is used to convert images to meaningfully rich vector embeddings. A classifier is used to classify these embeddings into one of 8 categories. After the training, the classifier is discarded and the feature extractor can be used for downstream tasks.

Usage Example:

training_args={"optimizer": Adam, "num_epochs": 1000, "batch_size": 256, "patch_size": 40, "patches_gap": 7}
trainer = ContextPredictionTrainer(training_args)
trainer.train(feature_extractor=feature_extractor, classifier=classifier, dataset=caltech101_dataset, training_args=training_args, learning_rate=3e-4)

About

PyTorch Implementation of "Unsupervised Visual Representation Learning by Context Prediction"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages