This file contains 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
def spec_to_image(spec, eps=1e-6): | |
mean = spec.mean() | |
std = spec.std() | |
spec_norm = (spec - mean) / (std + eps) | |
spec_min, spec_max = spec_norm.min(), spec_norm.max() | |
spec_scaled = 255 * (spec_norm - spec_min) / (spec_max - spec_min) | |
spec_scaled = spec_scaled.astype(np.uint8) | |
return spec_scaled |
This file contains 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 as nn | |
from torch.autograd import Variable | |
batch_size = 3 | |
max_length = 3 | |
hidden_size = 2 | |
n_layers =1 | |
# container |
This file contains 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 urllib | |
import time | |
import hmac | |
import hashlib | |
import base64 | |
def _sign_string(uri, key, key_name): | |
''' | |
100000 = milsecond expiry | |
''' |