All Projects → Hsankesara → Prototypical-Networks

Hsankesara / Prototypical-Networks

Licence: MIT License
A novel method for few shot learning

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Prototypical-Networks

teknowledge
A basic CS curriculum for coding in Python.
Stars: ✭ 26 (-44.68%)
Mutual labels:  computer
deviation-network
Source code of the KDD19 paper "Deep anomaly detection with deviation networks", weakly/partially supervised anomaly detection, few-shot anomaly detection
Stars: ✭ 94 (+100%)
Mutual labels:  few-shot-learning
ebook
Third edition of the Computer Networking: Principles, Protocols and Practice ebook
Stars: ✭ 64 (+36.17%)
Mutual labels:  computer
renet
[ICCV'21] Official PyTorch implementation of Relational Embedding for Few-Shot Classification
Stars: ✭ 72 (+53.19%)
Mutual labels:  few-shot-learning
asm-simulator
16-bit Assembler Simulator
Stars: ✭ 46 (-2.13%)
Mutual labels:  computer
awesome-gamedev
A compilation of game dev related media (podcasts, Youtube, article, books, etc..)
Stars: ✭ 49 (+4.26%)
Mutual labels:  computer
LearningToCompare-Tensorflow
Tensorflow implementation for paper: Learning to Compare: Relation Network for Few-Shot Learning.
Stars: ✭ 17 (-63.83%)
Mutual labels:  few-shot-learning
finetuner
Finetuning any DNN for better embedding on neural search tasks
Stars: ✭ 442 (+840.43%)
Mutual labels:  few-shot-learning
Zero-shot-Fact-Verification
Codes for ACL-IJCNLP 2021 Paper "Zero-shot Fact Verification by Claim Generation"
Stars: ✭ 39 (-17.02%)
Mutual labels:  few-shot-learning
FRN
(CVPR 2021) Few-Shot Classification with Feature Map Reconstruction Networks
Stars: ✭ 43 (-8.51%)
Mutual labels:  few-shot-learning
matching-networks
Matching Networks for one-shot learning in tensorflow (NIPS'16)
Stars: ✭ 54 (+14.89%)
Mutual labels:  few-shot-learning
Awesome-Few-Shot-Image-Generation
A curated list of papers, code and resources pertaining to few-shot image generation.
Stars: ✭ 209 (+344.68%)
Mutual labels:  few-shot-learning
few shot slot tagging and NER
PyTorch implementation of the paper: Vector Projection Network for Few-shot Slot Tagging in Natural Language Understanding. Su Zhu, Ruisheng Cao, Lu Chen and Kai Yu.
Stars: ✭ 17 (-63.83%)
Mutual labels:  few-shot-learning
FSL-Mate
FSL-Mate: A collection of resources for few-shot learning (FSL).
Stars: ✭ 1,346 (+2763.83%)
Mutual labels:  few-shot-learning
lowshot-shapebias
Learning low-shot object classification with explicit shape bias learned from point clouds
Stars: ✭ 37 (-21.28%)
Mutual labels:  few-shot-learning
WARP
Code for ACL'2021 paper WARP 🌀 Word-level Adversarial ReProgramming. Outperforming `GPT-3` on SuperGLUE Few-Shot text classification. https://aclanthology.org/2021.acl-long.381/
Stars: ✭ 66 (+40.43%)
Mutual labels:  few-shot-learning
Awesome-Weak-Shot-Learning
A curated list of papers, code and resources pertaining to weak-shot classification, detection, and segmentation.
Stars: ✭ 142 (+202.13%)
Mutual labels:  few-shot-learning
MeTAL
Official PyTorch implementation of "Meta-Learning with Task-Adaptive Loss Function for Few-Shot Learning" (ICCV2021 Oral)
Stars: ✭ 24 (-48.94%)
Mutual labels:  few-shot-learning
Meta-TTS
Official repository of https://arxiv.org/abs/2111.04040v1
Stars: ✭ 69 (+46.81%)
Mutual labels:  few-shot-learning
IT-Terms-EN-CN
English to Chinese Translation Table for IT Terminologies , ITEC (IT術語及計算機科學術語中英文對照表)
Stars: ✭ 53 (+12.77%)
Mutual labels:  computer

Prototypical Networks

Run on FloydHub

Artificial Intelligence is the new electricity - Andrew NG

The change occurred in our life after the expeditious growth in AI and deep learning, in particular, is a solid example of this. The research is booming at unprecedented speed and lives of thousands of people have been improved. If AI is the new electricity then definitely data is the new coal. But recently we’ve seen hazardous depletion in the amount of coal in our environment. This resulted in the development of new technologies which needed a fraction of coal or even no coal at all. Similarly, there are many applications in artificial intelligence where we only have meager data or even no data at all. Hence, we need new techniques to perform well in them. Such problems resulted in the growth of a very popular field, the field of N-shot learning.

To know about it more, go to my blog at N-Shot Learning: Learning More with Less Data.

To check out how this works, go to my notebook at kaggle

Basic Idea behind prototypical Network How prototypical Network works

Dataset

Omniglot Dataset

The network was trained on the Omniglot dataset. The Omniglot data set is designed for developing more human-like learning algorithms. It contains 1623 different handwritten characters from 50 different alphabets.

How to use the Module

First install all the necessary dependencies

pip3 install -r requirements.txt
  • Download the dataset and save it in the directory
  • To train, test and save your own model first import the PrototypicalNet module
from prototypicalNet import PrototypicalNet, train_step, test_step, load_weights
# Initializing prototypical net
protonet = PrototypicalNet(use_gpu)

You can use a pretrained model

# Using Pretrained Model
protonet = load_weights('./protonet.pt', protonet, use_gpu)

Or simply train one by yourself

import torch.optim as optim
# Set training iterations and display period
num_episode = 16000
frame_size = 1000
trainx = trainx.permute(0, 3, 1, 2)
testx = testx.permute(0, 3, 1, 2)
# Initializing prototypical net
protonet = PrototypicalNet(use_gpu)
optimizer = optim.SGD(protonet.parameters(), lr = 0.01, momentum=0.99)
# Training loop
frame_loss = 0
frame_acc = 0
for i in range(num_episode):
    loss, acc = train_step(protonet, trainx, trainy, 5, 60, 5, optimizer)
    frame_loss += loss.data
    frame_acc += acc.data
    if((i+1) % frame_size == 0):
        print("Frame Number:", ((i+1) // frame_size), 'Frame Loss: ',frame_loss.data.cpu().numpy().tolist() /
              frame_size, 'Frame Accuracy:', (frame_acc.data.cpu().numpy(.tolist() * 100) / frame_size)
        frame_loss = 0
        frame_acc = 0

To know more checkout this

Want to use a customized model?

No worries, simply download the code and make suitable changes here

Project Manager

Heet Sankesara

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].