Algorithm 1. Pre-Training Matching Network (MN) |
Input: Data set |
1: Initialize MN parameter x |
2: For each iteration do |
3: Sample training task from the data set, each task includes support set and query set |
4: Support set and query set were coded to get G and F |
5: Calculate the similarity between G and F |
6: Calculate the loss |
7: Update the parameters x through Adam optimizer |