4e0ad45a39073b751595d6e82c2ea53b0229386e,examples/trials/mnist-pytorch/mnist.py,,main,#,79

Before Change


    // report final result
    nni.report_final_result(test_acc)
    logger.debug("Final result is %g", test_acc)
    logger.debug("Send final result done.")



def get_params():

After Change


        train(args, model, device, train_loader, optimizer, epoch)
        test_acc = test(args, model, device, test_loader)

        if epoch < args["epochs"]:
            // report intermediate result
            nni.report_intermediate_result(test_acc)
            logger.debug("test accuracy %g", test_acc)
            logger.debug("Pipe send intermediate result done.")
        else:
            // report final result
            nni.report_final_result(test_acc)
            logger.debug("Final result is %g", test_acc)
            logger.debug("Send final result done.")


def get_params():
    // Training settings
    parser = argparse.ArgumentParser(description="PyTorch MNIST Example")
    parser.add_argument("--data_dir", type=str,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: microsoft/nni
Commit Name: 4e0ad45a39073b751595d6e82c2ea53b0229386e
Time: 2019-09-09
Author: suiguoxin@gmail.com
File Name: examples/trials/mnist-pytorch/mnist.py
Class Name:
Method Name: main