One-shot learning means recognizing a face or predicting the target vector with only 1 image or sample.
For example, there is a database of images of employees working at a firm. The problem is that it includes only 1 image per employee.
To do this, we make our Neural Network learn a similarity function where we feed in two images and the algorithm outputs the degree of difference between ($\tau$ being a certain threshold) then,
d(img1,img2)
= $\tau$
d(img1,img2)
$\leq \tau$, then it's the same image.This helps us to solve the one-shot learning problem.
When the Neural Network receives a new input image, it is fed into the similarity algorithm with the other images from the database and outputs $\tau$.