Skip to content

Instantly share code, notes, and snippets.

@omarsar
Created August 19, 2018 03:12
Show Gist options
  • Save omarsar/a64ec7f8687b1a17d17c429c34ef8a03 to your computer and use it in GitHub Desktop.
Save omarsar/a64ec7f8687b1a17d17c429c34ef8a03 to your computer and use it in GitHub Desktop.
dataiter = iter(trainloader)
images, labels = dataiter.next()
model = ImageRNN(BATCH_SIZE, N_STEPS, N_INPUTS, N_NEURONS, N_OUTPUTS)
logits = model(images.view(-1, 28,28))
print(logits[0:10])
### output
'''
tensor([[-0.0197, 0.0082, 0.0248, 0.0758, -0.0110, 0.0521, -0.0261, 0.0217,
-0.0083, 0.0866],
[-0.0214, 0.0173, 0.0255, 0.0715, -0.0092, 0.0486, -0.0253, 0.0214,
-0.0141, 0.0909],
...
[-0.0187, 0.0199, 0.0317, 0.0743, -0.0061, 0.0488, -0.0273, 0.0223,
-0.0152, 0.0881],
[ 0.0012, 0.0542, 0.0261, 0.0561, -0.0549, 0.0510, 0.0108, 0.0414,
-0.0394, 0.0897]], grad_fn=<SliceBackward>)
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment