Research Article
Fast and Accurate Deep Leakage from Gradients Based on Wasserstein Distance
Algorithm 2
Wasserstein distance calculation algorithm (WDCA).
| | Input: input original gradient , virtual gradient . | | (1) | Initialization | | (2) | //Calculate the cost matrix | | (3) | | | (4) | | | (5) | | | (6) | for to do | | (7) | | | (8) | | | (9) | If , then | | (10) | | | (11) | | | (12) | | | (13) | end if | | (14) | end for | | (15) | // obtains an approximation of the Wasserstein distance | | | Output: |
|