hyperas icon indicating copy to clipboard operation
hyperas copied to clipboard

Retrieve actual values from Trial object

Open bennyooo opened this issue 7 years ago • 2 comments

Hi, how is one supposed to retrieve the actual values from the Trial object e.g. to print/plot the information? For instance if I have the Dropout set by "choice" how can I display the actual value that is chosen at the moment instead of the index? I know that I can show the actual values of the best_run by adding the flag eval_space = True but how is that achievable with every single trial?

bennyooo avatar Jan 29 '18 12:01 bennyooo

@bennyooo Iterating over the trials object gives you the information you want. It has the results dict from each trial and a bunch of extra trial information like what parameters are used.

JonnoFTW avatar Mar 16 '18 13:03 JonnoFTW

    ```evals = 100
    X_train,y_train,X_val,y_val,X_test,y_test = data()
    trials = Trials() #This is important to instantiate before
    best_run, best_model = optim.minimize(model=create_model, data=data,
    functions = [process_data],
    algo=tpe.suggest,max_evals=evals,trials=trials)
    
    print("----------trials-------------")
    for i in trials.trials:
        vals = i.get('misc').get('vals')
        results = i.get('result').get('loss')
        print(vals,results)```

haramoz avatar Sep 30 '18 08:09 haramoz