microsoft / nni

An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.
https://nni.readthedocs.io
MIT License
14.02k stars 1.81k forks source link

my nni repeats the same experiment. #4619

Closed fkaus5555 closed 2 years ago

fkaus5555 commented 2 years ago

Describe the issue: I'm experimenting with changing the nni tutorial(mnist) a bit.

I expected to perform hyperparameter search as many as the number of 'search_space.jsom' cases I set. However, several of the nni results have the same hyper-parameter and show the same results.

Environment:

Configuration: here is my 'config.yml'


searchSpaceFile: search_space.json
trialCommand: python3 ../train.py --epoch 5  # NOTE: change "python3" to "python" if you are using Windows
trialGpuNumber: 0
trialConcurrency: 1
tuner:
  name: TPE
  classArgs:
    optimize_mode: maximize
trainingService:
  platform: local

my 'search_space.json'

{
    "batch_size": {"_type":"choice", "_value": [16, 20, 32, 64]},
    "lr":{"_type":"choice","_value":[0.0001, 0.001, 0.01, 0.1]},
    "optimizer":{"_type":"choice","_value":["Adam", "SGD"]},
    "criterion":{"_type":"choice","_value":["cross_entropy", "focal", "label_smoothing"]}
}

Log message:

cruiseliu commented 2 years ago

It is common for tuning algorithms to generate duplicate parameters when the search space is small. The dedup feature is under development. For now you may try GridSearch tuner for small search spaces.

scarlett2018 commented 2 years ago

It is common for tuning algorithms to generate duplicate parameters when the search space is small. The dedup feature is under development. For now you may try GridSearch tuner for small search spaces.

@fkaus5555 - I'm closing the question as it has been answered as above. feel free to reopen the issue if the answer is not satisficing (having more questions or not answering the correct problem).

cruiseliu commented 2 years ago

Fixed in #4679 Will be included in 2.7 release.