{"id":18428597,"url":"https://github.com/sthalles/simclr-tensorflow","last_synced_at":"2025-04-07T17:32:06.743Z","repository":{"id":44378238,"uuid":"246009130","full_name":"sthalles/SimCLR-tensorflow","owner":"sthalles","description":"TensorFlow Implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations","archived":false,"fork":false,"pushed_at":"2020-03-10T10:53:19.000Z","size":33,"stargazers_count":27,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T21:51:11.380Z","etag":null,"topics":["contrastive-learning","contrastive-loss","representation-learning","self-supervised-learning","simclr","tensorflow","unsupervised-learning"],"latest_commit_sha":null,"homepage":"https://sthalles.github.io/simple-self-supervised-learning/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sthalles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-09T10:44:18.000Z","updated_at":"2024-10-23T03:06:08.000Z","dependencies_parsed_at":"2022-07-12T18:20:35.598Z","dependency_job_id":null,"html_url":"https://github.com/sthalles/SimCLR-tensorflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sthalles%2FSimCLR-tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sthalles%2FSimCLR-tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sthalles%2FSimCLR-tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sthalles%2FSimCLR-tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sthalles","download_url":"https://codeload.github.com/sthalles/SimCLR-tensorflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247697798,"owners_count":20981251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contrastive-learning","contrastive-loss","representation-learning","self-supervised-learning","simclr","tensorflow","unsupervised-learning"],"created_at":"2024-11-06T05:14:08.860Z","updated_at":"2025-04-07T17:32:06.519Z","avatar_url":"https://github.com/sthalles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TensorFlow implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations\n\n## Still under development!!\n\n### Blog post with full documentation: [Exploring SimCLR: A Simple Framework for Contrastive Learning of Visual Representations](https://sthalles.github.io/simple-self-supervised-learning/)\n\n#### For a Pytorch Implementation: [PyTorch SimCLR](https://github.com/sthalles/SimCLR)\n\n![Image of SimCLR Arch](https://sthalles.github.io/assets/contrastive-self-supervised/cover.png)\n\n## Dependencies\n\n- tensorflow 2.x\n\n## Config file\n\nBefore running SimCLR, make sure you choose the correct running configurations on the ```config.yaml``` file.\n\n```yaml\nbatch_size: 256 # A batch size of N, produces 2 * (N-1) negative samples. Original implementation uses a batch size of 8192\nout_dim: 64 # Output dimensionality of the embedding vector z. Original implementation uses 2048\ns: 1\ntemperature: 0.5 # Temperature parameter for the contrastive objective\nbase_convnet: \"resnet18\" # The ConvNet base model. Choose one of: \"resnet18 or resnet50\". Original implementation uses resnet50\nuse_cosine_similarity: True # Distance metric for contrastive loss. If False, uses dot product\nepochs: 40 # Number of epochs to train\nnum_workers: 4 # Number of workers for the data loader\n```\n\n## Feature Evaluation\n\nFeature evaluation is done using a linear model protocol. Feature are learned using the ```STL10 unsupervised``` set and evaluated in the train/test splits;\n\nCheck the ```feature_eval/FeatureEvaluation.ipynb``` notebook for reproducebility.\n\n|  Feature Extractor  |    Method    | Architecture | Top 1 |\n|:-------------------:|:------------:|:------------:|:-----:|\n| Logistic Regression | PCA Features |       -      |   -   |\n|         KNN         | PCA Features |       -      |   -   |\n| Logistic Regression |    SimCLR    |   ResNet-18  |   -   |\n|         KNN         |    SimCLR    |   ResNet-18  |   -   |\n\n## Download pre-trained model \n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsthalles%2Fsimclr-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsthalles%2Fsimclr-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsthalles%2Fsimclr-tensorflow/lists"}