import torch


def init_train_utils(encoder, decoder, learing_rate=1e-2):
    """
    Creates necessary objects for training
    returns: criterion, encoder_optimizer, decoder_optimizer
    """
    criterion = torch.nn.NLLLoss()
    encoder_optimizer = torch.optim.SGD(encoder.parameters(), lr=learing_rate)
    decoder_optimizer = torch.optim.SGD(decoder.parameters(), lr=learing_rate)
    return criterion, encoder_optimizer, decoder_optimizer