| Algorithm 1 Training Algorithm of SAD-SNN | |
|
Input: Dataset . Model: Teacher ANN model with pretrained weights ; Student SNN model with initial weights . Parameter: Time steps T; Layer alignment set ; Distillation loss weight ; Learning rate ; Training epoch E. Output: Trained student SNN model . 1: for to E do 2: for x, y in do | |
| 3: ; | ▹ forward propagation |
| 4: ; | |
| 5: ; | ▹ calculate spatial-activation maps |
| 6: calculate and based on and using (4); | |
| 7: calculate based on and | |
| 8: using layer pairs via (5); | ▹ calculate |
| 9: calculate task-specific loss based on y and ; | ▹ calculate |
| 10: calculate based on and using (6); | ▹ calculate |
| 11: calculate the gradients ; | ▹ backward propagation |
| 12: update ; | ▹ update weights |
| 13: end for | |
| 14: end for | |