Coder Social home page Coder Social logo

minyus / optkeras Goto Github PK

View Code? Open in Web Editor NEW
29.0 2.0 3.0 38.1 MB

OptKeras: wrapper around Keras and Optuna for hyperparameter optimization

Home Page: https://medium.com/@Minyus86/optkeras-112bcc34ec73

License: Other

Python 100.00%
keras optuna hyperparameter-optimization hyperparameters deep deep-learning neural-network

optkeras's People

Contributors

minyus avatar mludvik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

optkeras's Issues

colab notebook default example error

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

"trial_best_logs" reset every epoch

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

ModuleNotFoundError: No module named 'optuna.structs'

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.