hyperas
hyperas copied to clipboard
Error if no hyperparameter search before choice between different models
Using the frontpage complete MNIST example, the below only works if some hyperparameter search is added after Sequential
model = Sequential()
model.add(Dense({{choice([100, 200])}})) # This works
# model.add(Activation({{choice([None])}})) # This also works. Yes, it's commented out!
if {{choice(['mdl1', 'mdl2'])}} == 'mdl1':
model.add(Dense({{choice([100, 200])}}))
model.add(Activation('relu'))
else:
model.add(Dense({{choice([100, 200])}}))
model.add(Activation('relu'))
model.add(Dense(10))
model.add(Activation('softmax'))
Even commenting out the first line also works. But removing it entirely throws the classic IndexError: list index out of range
.
@Komodovaran thanks, this is an interesting edge case I actually never considered. good catch!