← 开源
davidtellez

contrastive-predictive-coding

Keras implementation of Representation Learning with Contrastive Predictive Coding

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
561
Star
119
Fork
+1
本周
1
贡献者
创建于 2018-09-14 · 更新于 2026-10-11 · 今日第 16995 名
主要开发者
davidtellez

davidtellez/contrastive-predictive-coding 排名第 16,995,有 561 个星标。

同类别比较

davidtellez/contrastive-predictive-coding 排名第 16,995,此处有 8 个同类条目;google-research/batch_rl 排名第 16,998。

同类别比较
名称排名指标
voidism/DoLa16,982
语言:
Python
星标数:
562
分叉数:
67
简介:
Official implementation for the paper "DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models"
yandex/faster-rnnlm16,984
语言:
C++
星标数:
562
分叉数:
138
简介:
Faster Recurrent Neural Network Language Modeling Toolkit with Noise Contrastive Estimation and Hierarchical Softmax
Adamdad/keras-YOLOv3-mobilenet16,987
语言:
Python
星标数:
561
分叉数:
162
简介:
I transfer the backend of yolov3 into Mobilenetv1,VGG16,ResNet101 and ResNeXt101
EducationalTestingService/skll16,989
语言:
Python
星标数:
561
分叉数:
69
简介:
SciKit-Learn Laboratory (SKLL) makes it easy to run machine learning experiments.
google-research/batch_rl16,998
语言:
Python
星标数:
561
分叉数:
73
简介:
Offline Reinforcement Learning (aka Batch Reinforcement Learning) on Atari 2600 games
hustvl/ViTMatte16,999
语言:
Python
星标数:
561
分叉数:
50
简介:
[Information Fusion (Vol.103, Mar. '24)] Boosting Image Matting with Pretrained Plain Vision Transformers
kmaninis/OSVOS-PyTorch17,001
语言:
Python
星标数:
561
分叉数:
104
简介:
PyTorch implementation of One-Shot Video Object Segmentation (OSVOS)
torch/distro17,010
语言:
CMake
星标数:
561
分叉数:
481
简介:
Torch installation in a self-contained folder
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
星标数561
分叉数119
贡献者1
创建日期2018-09-14
更新日期2026-10-11
1 天星标数0
7 天星标数1
排名16,995
上次排名16,784
排名变化-211
7 天星标排名11,341
上次 7 天星标排名11,402
7 天星标排名变化61
总星标排名17,698
上次总星标排名17,665
总星标排名变化-33
国家Netherlands
README 摘录

Representation Learning with Contrastive Predictive Coding This repository contains a Keras implementation of the algorithm presented in the paper Representation Learning with Contrastive Predictive Coding. The goal of unsupervised representation learning is to capture semantic information about the world, recognizing patterns in the data without using annotations. This paper presents a new method called Contrastive Predictive Coding (CPC) that can do so across multiple applications. The main ideas of the paper are: Contrastive: it is trained using a contrastive approach

, that is, the main model has to discern between *right* and *wrong* data sequences. Predictive: the model has to predict future patterns given the current context. Coding: the model performs this prediction in a latent space, transforming code vectors into other code vectors (in contrast with predicting high-dimensional data directly). CPC has to predict the next item in a sequence using only an embedded representation of the data, provided by an encoder. In order to solve the task, this

encoder has to learn a meaningful representation of the data space. After training, this encoder can be used for other downstream tasks like supervised classification. To train the CPC algorithm, I have created a toy dataset. This dataset consists of sequences of modified MNIST numbers (64x64 RGB). Positive sequence samples contain *sorted* numbers, and negative ones *random* numbers. For example, let's assume that the context sequence length is S=4, and CPC is asked to predict the next P=2

numbers. A positive sample could look like , whereas a negative one could be . Of course CPC will only see the patches, not the actual numbers. Disclaimer: this code is provided *as is*, if you encounter a bug please report it as an issue. Results After 10 training epochs, CPC reports a 99% accuracy on the contrastive task. After training, I froze the encoder and trained a MLP on top of it to perform supervised digit classification on the same MNIST

data. It achieved 90% accuracy after 10 epochs, demonstrating the effectiveness of CPC for unsupervised feature extraction. Execute to train the MLP on top of the CPC encoder. References Representation Learning with Contrastive Predictive Coding

常见问题

记录了多少星标和分叉?

davidtellez/contrastive-predictive-coding 有 561 个星标和 119 个分叉。

仓库排名是多少?

davidtellez/contrastive-predictive-coding 排名第 16,995。

记录的语言和类别是什么?

davidtellez/contrastive-predictive-coding 有 561 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

davidtellez/contrastive-predictive-coding 与 google-research/batch_rl 比较,后者排名第 16,998,有 561 个星标。

README

Representation Learning with Contrastive Predictive Coding

This repository contains a Keras implementation of the algorithm presented in the paper Representation Learning with Contrastive Predictive Coding.

The goal of unsupervised representation learning is to capture semantic information about the world, recognizing patterns in the data without using annotations. This paper presents a new method called Contrastive Predictive Coding (CPC) that can do so across multiple applications. The main ideas of the paper are:

  • Contrastive: it is trained using a contrastive approach, that is, the main model has to discern between right and wrong data sequences.
  • Predictive: the model has to predict future patterns given the current context.
  • Coding: the model performs this prediction in a latent space, transforming code vectors into other code vectors (in contrast with predicting high-dimensional data directly).

CPC has to predict the next item in a sequence using only an embedded representation of the data, provided by an encoder. In order to solve the task, this encoder has to learn a meaningful representation of the data space. After training, this encoder can be used for other downstream tasks like supervised classification.

To train the CPC algorithm, I have created a toy dataset. This dataset consists of sequences of modified MNIST numbers (64x64 RGB). Positive sequence samples contain sorted numbers, and negative ones random numbers. For example, let's assume that the context sequence length is S=4, and CPC is asked to predict the next P=2 numbers. A positive sample could look like [2, 3, 4, 5]->[6, 7], whereas a negative one could be [1, 2, 3, 4]->[0, 8]. Of course CPC will only see the patches, not the actual numbers.

Disclaimer: this code is provided as is, if you encounter a bug please report it as an issue. Your help will be much welcomed!

Results

After 10 training epochs, CPC reports a 99% accuracy on the contrastive task. After training, I froze the encoder and trained a MLP on top of it to perform supervised digit classification on the same MNIST data. It achieved 90% accuracy after 10 epochs, demonstrating the effectiveness of CPC for unsupervised feature extraction.

Usage

  • Execute python train_model.py to train the CPC model.
  • Execute python benchmark_model.py to train the MLP on top of the CPC encoder.

Requisites

References

排名相邻
同类项目