sherpa-ai / sherpa

Hyperparameter optimization that enables researchers to experiment, visualize, and scale quickly.
http://parameter-sherpa.readthedocs.io/
GNU General Public License v3.0
331 stars 53 forks source link

Sherpa Dashboard Links Invalid #92

Open kjmayer opened 4 years ago

kjmayer commented 4 years ago

Hi,

When I run my code, the links provided to access the dashboard are invalid. I tried using the key disable_dashboard = True in sherpa.Study and then after running all my code, sherpa.Study.load_dashboard(".") to load the dashboard, but those links do not work either.

Here is the code:

parameters = [sherpa.Continuous(name='lr', range=[0.005, 0.1], scale='log'),
              sherpa.Continuous(name='dropout', range=[0., 0.4]),
              sherpa.Ordinal(name='batch_size', range=[16, 32, 64, 256, 512, 1024]),
              sherpa.Discrete(name='num_hidden_units', range=[1, 300]),
              sherpa.Choice(name='activation', range=['sigmoid', 'relu'])]
algorithm = sherpa.algorithms.RandomSearch(max_num_trials=10)
study = sherpa.Study(parameters=parameters,
                 algorithm=algorithm, disable_dashboard=False,
                 lower_is_better=False)

for trial in study:
    model = Sequential()
    model.add(Dense(units=trial.parameters['num_hidden_units'], activation=trial.parameters['activation'], input_dim=np.shape(Xin)[1]))
    model.add(Dense(np.shape(Yout)[1], activation='softmax'))
    model.compile(loss='binary_crossentropy', optimizer=optimizers.Adam(trial.parameters['lr']), metrics=['accuracy'])

    model.fit(x_train, y_train, epochs=5, batch_size=trial.parameters['batch_size'])

    loss,acc = model.evaluate(x_test,y_test)

    study.add_observation(trial=trial, objective=acc, context={'loss':loss})

    if study.should_trial_stop(trial):
      break

    study.finalize(trial)

study.save(".")
LarsHH commented 4 years ago

Hi @kjmayer ,

Mind if I ask what operating system you run on? If you're running this on your laptop/desktop (that is, you're not ssh'ed into a machine to run this), can you try to take one of the addresses Sherpa is giving you and then just type into your browser localhost:<port> or http://127.0.0.1:<port> where <port> is the port (the number after the colon) in the address that sherpa is giving you.

Let me know whether this helps at all.

Best, Lars