minyus / optkeras Goto Github PK
View Code? Open in Web Editor NEWOptKeras: wrapper around Keras and Optuna for hyperparameter optimization
Home Page: https://medium.com/@Minyus86/optkeras-112bcc34ec73
License: Other
OptKeras: wrapper around Keras and Optuna for hyperparameter optimization
Home Page: https://medium.com/@Minyus86/optkeras-112bcc34ec73
License: Other
I run the link of your colab notebook as is and I receive the following AssertionError at every run
[W 2020-07-02 16:28:05,165] Setting status of trial#0 as TrialState.FAIL because of the following error: AssertionError('[OptKeras] Monitor variable needs to be in the logs dictionary. Use a callback.',)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/optuna/study.py", line 469, in _run_trial
result = func(trial)
File "/usr/local/lib/python3.6/dist-packages/optkeras/optkeras.py", line 130, in fun_tf
return fun(trial)
File "<ipython-input-6-acfc70c5c697>", line 41, in objective
verbose=ok.keras_verbose )
File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1239, in fit
validation_freq=validation_freq)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_arrays.py", line 216, in fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "/usr/local/lib/python3.6/dist-packages/keras/callbacks/callbacks.py", line 152, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/usr/local/lib/python3.6/dist-packages/optkeras/optkeras.py", line 300, in on_epoch_end
assert self.monitor in logs, '[OptKeras] Monitor variable needs to be in the logs dictionary. Use a callback.'
AssertionError: [OptKeras] Monitor variable needs to be in the logs dictionary. Use a callback.
it simply doesn't optimize anything
resetting the trial best logs should occur "on_train_begin" instead of "on_epoch_begin". The result now in the case of "mode_max" =True, logs reset every epoch during a single trial
In case you wanted to take a look: https://stackoverflow.com/questions/62656411/optkeras-keras-optuna-wrapper-use-optkeras-inside-my-own-class-attributeerr
Thanks for the Keras wrapper for Optuna!
When I try to import Optkeras with from optkeras.optkeras import OptKeras
I get the following error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In [8], line 27
25 import logging
26 import optuna
---> 27 from optkeras.optkeras import OptKeras
28 from sklearn.preprocessing import MinMaxScaler
29 scaler = MinMaxScaler()
File ~/.conda/envs/deeplearning/lib/python3.10/site-packages/optkeras/optkeras.py:392
390 from optuna.pruners import BasePruner
391 from optuna.storages import BaseStorage # NOQA
--> 392 from optuna.structs import TrialState
395 class RepeatPruner(BasePruner):
396 """ Prune if the same parameter set was found in Optuna database
397 Coded based on source code of MedianPruner class at
398 https://github.com/pfnet/optuna/blob/master/optuna/pruners/median.py
399 """
ModuleNotFoundError: No module named 'optuna.structs'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.