my_model = AdamNet(EMBEDDING_DIM, HIDDEN_DIM, len(word_to_ix), len(tag_to_ix)) loss_function = nn.NLLLoss() optimizer = optim.SGD(my_model.parameters(), lr=0.1) device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")