Commit 4e0ad45a authored by Guoxin's avatar Guoxin Committed by xuehui
Browse files

add config test for mnist torch exp (#1523)

* add mnist pytorch example

* refine comments

* change links in readme for mnist example

* add config test for pytorch mnist example

* delete duplicated result
parent 3d7113db
...@@ -108,17 +108,16 @@ def main(args): ...@@ -108,17 +108,16 @@ def main(args):
train(args, model, device, train_loader, optimizer, epoch) train(args, model, device, train_loader, optimizer, epoch)
test_acc = test(args, model, device, test_loader) test_acc = test(args, model, device, test_loader)
# report intermediate result if epoch < args['epochs']:
nni.report_intermediate_result(test_acc) # report intermediate result
logger.debug('test accuracy %g', test_acc) nni.report_intermediate_result(test_acc)
logger.debug('Pipe send intermediate result done.') logger.debug('test accuracy %g', test_acc)
logger.debug('Pipe send intermediate result done.')
test_acc = test(args, model, device, test_loader) else:
# report final result # report final result
nni.report_final_result(test_acc) nni.report_final_result(test_acc)
logger.debug('Final result is %g', test_acc) logger.debug('Final result is %g', test_acc)
logger.debug('Send final result done.') logger.debug('Send final result done.')
def get_params(): def get_params():
......
authorName: nni
experimentName: default_test
maxExecDuration: 15m
maxTrialNum: 4
trialConcurrency: 2
searchSpacePath: ./mnist_pytorch_search_space.json
tuner:
builtinTunerName: Random
assessor:
builtinAssessorName: Medianstop
classArgs:
optimize_mode: maximize
trial:
codeDir: ../../../examples/trials/mnist-pytorch
command: python3 mnist.py --epochs 2
gpuNum: 0
useAnnotation: false
multiPhase: false
multiThread: false
trainingServicePlatform: local
{
"batch_size": {"_type":"choice", "_value": [16, 32, 64, 128]},
"hidden_size":{"_type":"choice","_value":[128, 256, 512, 1024]},
"lr":{"_type":"choice","_value":[0.0001, 0.001, 0.01, 0.1]},
"momentum":{"_type":"uniform","_value":[0, 1]}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment