- Hands-On Meta Learning with Python
- Sudharsan Ravichandiran
- 245字
- 2021-07-02 14:29:22
Algorithm
Now, we will better understand the Gaussian prototypical network by going through it step by step:
- Let's say we have a dataset, D = {(x1, y1,), (x2, y2), ... (xi, yi)}, where x is the feature and y is the label. Let's say we have a binary label, which means we have only two classes, 0 and 1. We will sample data points at random without replacement from each of the classes from our dataset, D, and create our support set, S.
- Similarly, we sample data points at random per class and create the query set, Q.
- We will pass the support set to our embedding function, f(). The embedding function will generate the embeddings for our support set, along with the covariance matrix.
- We calculate the inverse of the covariance matrix.
- We compute the prototype of each class in the support set as follows:

In this equation, is the diagonal of the inverse covariance matrix,
denotes the embeddings of the support set and superscript c denotes the class.
- After computing the prototype of each class in the support set, we learn the embeddings for the query set, Q. Let's say x' is the embedding of the query point.
- We calculate the distance of the query point embeddings to the class prototypes as follows:

- After calculating the distance between the class prototype and query set embeddings, we predict the class of the query set as a class that has a minimum distance, as follows:

推薦閱讀
- Mastering Ninject for Dependency Injection
- Python數據分析入門:從數據獲取到可視化
- 使用GitOps實現Kubernetes的持續部署:模式、流程及工具
- Visual Studio 2015 Cookbook(Second Edition)
- 大數據:規劃、實施、運維
- Learn Unity ML-Agents:Fundamentals of Unity Machine Learning
- Power BI商業數據分析完全自學教程
- 深入理解InfluxDB:時序數據庫詳解與實踐
- Unreal Engine Virtual Reality Quick Start Guide
- SIEMENS數控技術應用工程師:SINUMERIK 840D-810D數控系統功能應用與維修調整教程
- Oracle 11g+ASP.NET數據庫系統開發案例教程
- 數據庫應用系統技術
- Kubernetes快速進階與實戰
- Oracle 11g數據庫管理員指南
- 一本書讀懂大數據