Last active
July 25, 2019 02:40
-
-
Save heffo42/ce9e7d70c5c2dffedc99fd2599cf5423 to your computer and use it in GitHub Desktop.
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
start = np.random.randint(0,len(valid_list) - 150) | |
seed_list = valid_list[start:start+20] | |
current_string = [string2int[string] for string in seed_list] | |
for i in range(20): | |
input = torch.tensor(current_string,dtype=torch.long).cuda().reshape(1,-1) | |
output = model(input) | |
_, predicted = torch.max(output[:,-1,:], 1) | |
current_string.append(predicted.item()) | |
print(' '.join(seed_list)) | |
print(' '.join(int2string[x] for x in current_string)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment