Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Can not submit customized trial when I used BatchTuner #2075

Closed
Sundrops opened this issue Feb 18, 2020 · 0 comments · Fixed by #2116
Closed

Can not submit customized trial when I used BatchTuner #2075

Sundrops opened this issue Feb 18, 2020 · 0 comments · Fixed by #2116
Assignees
Labels

Comments

@Sundrops
Copy link
Contributor

Sundrops commented Feb 18, 2020

image
nni/src/webui/src/components/Modal/CustomizedTrial.tsx

        Object.keys(customized).map(item => {
           .......
                // the item(optimizer/learning_rate) is not in the keys of searchSpace using BatchTuner.
                // search space: {"combine_params": xxxxxxx}
                if (searchSpace[item]._type === 'choice') {
                    if (searchSpace[item]._value.find((val: string | number) =>
                        val === customized[item]) === undefined) {
                        flag = true;
                        return;
                    }
                } else {
                    if (customized[item] < searchSpace[item]._value[0]
                        || customized[item] > searchSpace[item]._value[1]) {
                        flag = true;
                        return;
                    }
                }
            }
        });

nni/src/sdk/pynni/nni/batch_tuner/batch_tuner.py

    def is_valid(self, search_space):
.......
# the key: combine_params is removed
            if isinstance(search_space[param][VALUE], list):
                return search_space[param][VALUE]
    def generate_parameters(self, parameter_id, **kwargs):
......
        return self._values[self._count]

An imperfect solution is as follow. But this solution can not check whether the customized setting is in existing search space when you use BatchTuner

        Object.keys(customized).map(item => {
                # fix bug
                if (searchSpace[item] === undefined) {
                    return;
                }
                if (searchSpace[item]._type === 'choice') {
                    if (searchSpace[item]._value.find((val: string | number) =>
                        val === customized[item]) === undefined) {
                        flag = true;
                        return;
                    }
        });
@scarlett2018 scarlett2018 added bug Something isn't working user raised labels Feb 24, 2020
@liuzhe-lz liuzhe-lz linked a pull request Mar 3, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants