This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import torch.nn | |
| from torch.autograd import Variable | |
| def pairwise_euclidean(samples): | |
| B = samples.size(0) | |
| samples_norm = samples.mul(samples).sum(1) | |
| samples_norm = samples_norm.expand(B, B) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| def download_file_from_google_drive(id, destination): | |
| def get_confirm_token(response): | |
| for key, value in response.cookies.items(): | |
| if key.startswith('download_warning'): | |
| return value | |
| return None |
OlderNewer