# Train model:
    model, loss_data = my_models.train_model(model,
                                             optimizer,
                                             train_loader,
                                             val_loader,
                                             device,
                                             dtype,
                                             epoches=2)

    # Save model to file:
    torch.save(model.state_dict(), MODEL_PATH + MODEL_NAME)

    # Save loss data to file:
    np.savetxt(LOSS_PATH + 'data_part_4_train.csv', loss_data, delimiter=',')
    fix_loss_data('data_part_4_train.csv')
    print('Training is Finished !')
if test:
    print('Checking model Accuracy over Test Set...')
    if model is None:
        # load model:
        model = my_models.model_2()
        model.load_state_dict(torch.load(MODEL_PATH + MODEL_NAME))
    model.eval()

    # Check accuracy on test set:
    test_acc = my_models.check_accuracy(test_loader, model, device, dtype)

    # Saving acc to file
    acc_train_data = np.loadtxt(LOSS_PATH + 'data_part_4_train.csv',
                                delimiter=',')
    # Train model:
    model, loss_data = my_models.train_model(model,
                                             optimizer,
                                             train_loader,
                                             val_loader,
                                             device,
                                             dtype,
                                             epoches=2,
                                             print_every=5)

    # Save model to file:
    torch.save(model.state_dict(), MODEL_PATH + MODEL_NAME)

    # Save loss data to file:
    np.savetxt(LOSS_PATH + 'data_part_4_train.csv', loss_data, delimiter=',')
    fix_loss_data('data_part_4_train.csv', SECTION_PATH)
    print('Training is Finished !')
if test:
    print('Checking model Accuracy over Test Set...')
    if model is None:
        # load model:
        model = my_models.model_2()
        model.load_state_dict(torch.load(MODEL_PATH + MODEL_NAME))
    model.eval()

    # Check accuracy on test set:
    test_acc = my_models.check_accuracy(test_loader, model, device, dtype)

    # Saving acc to file
    acc_train_data = np.loadtxt(LOSS_PATH + 'data_part_4_train.csv',
                                delimiter=',')